Transmission issue?

I recently purchased a 2005 V6 Mustang (5 spd) with 27,000 miles on it, about a month ago. All has been well for the past month or so, except for today. I had pulled over to adjust my seat, and when I went to restart the car, it started to turn over, and made an awful grinding sound. So I immediately stopped and tried again and it started right up. This happened later in the day again. I didn't think much of it until I was at my friends house and her door bell rang, and someone, said, "your car is in the street." It had rolled down her driveway and into the street. I am 100% sure that I parked in 1st gear and pulled the hand brake all the way up as high as I could, seeing as her driveway is quite steep. What could have caused my car to kick itself out of gear, and shouldn't the handbrake have held it? I have also noticed if I park on a hill and don't use the handbrake in 1st gear, shouldn't the car still be able to be held in place with 1st(I was told this by my father, who owned a stick a few years back), so is it some disengage doohickey that I am overlooking?

Thanks for reading guys, if I made something unclear, post and let me know and I'll do my best to rephrase it. I appreciate the help.

-Zach