Well... good advice thus far I would say. The only thing I can offer is this:
COTS - you said that he starts to "lose steam" in the middle of the act, and that he doesn't seem to notice. I seriously doubt he doesn't notice... maybe he's too self conscious/embarrassed by it to bring himself to be ABLE to say anything or make it obvious that he notices. I would imagine that if it's happened more than once, he might just be completely preoccupied with hoping it doesn't happen again, and looses arousal. I mean I would... I can only imagine what a blow to his self esteem it could be just knowing that it's happened, worrying that "he's not man enough" to satisfy you, etc - and who could be completely sexually aroused with thoughts like that floating through their head.
That said, this happens all the time - there's nothing "wrong" with either of you. Talk to him sweetness... you love him, and he loves you. Even if it happens again, it's not the end of the world - right? He needs to know from you that it's not and that there is nothing for him to feel insecure about. At the same time, you need to know that from him - sounds like you might be thinking/wondering/feeling "maybe this is happening because he's not attracted to me/I don't turn him on/something's wrong with me". Be patient, reassure him, and try to figure out a way to talk about it.
If it persists - get him some Viagra/Cialis. It'll get so hard you could break it off - his stud status will be restored and you'll get your brains fucked out.
All of the above is assuming that it's psychological, and that there is not a real physical problem. If he talks to a Doctor about it, the first thing the Doctor will ask to determine if it's a psychological issue or physical will be if he gets erections in his sleep. Does he have morning wood? If he does, he is physically capable of getting hard and chances are he's so worried about keeping it up he looses arousal. It'll work out.