People have come back from worse.
Stay confident, re-take the D, figure out what went wrong: poor study habits? didn't understand the material and should go to office hours or ask questions? Don't let your ego get in the way from working with a tutor on campus. Working too much? Are you giving yourself a break at all?
Pull in good grades the rest of your way, be active in ECs/volunteer, and you'll be fine. The application cycle is a crap shoot for everyone, there are no guarantees. There's a kid in my program who had a 3.9 and a 37, got 6 interviews, and no acceptances or wait-lists. Why? Because he's a douche. Its more than a numbers game. Work hard and become known as some one who is both talented and puts in the effort, and is someone other people can count on, and you'll do fine. Demand success and strive for success.