Hi,
Sorry to hear you've been going through some tough times -- grades what you make them, I suppose. You can only do your best, and nobody can fault you for that.
To answer part of your question, of course. I've had many times I've woken up and not realised when or how I'd even fallen asleep. Sometimes it just happens from exhaustion, it's completely normal (as far as I'm aware anyway!)
University isn't for everyone, just try to think of the positives. You probably met some very good friends, had some good experiences, and you're close to finishing - not failing!
Josh