This isn't unusual or anything to be worried about. Since he was already asleep it's quite likely his hands ended up where they did randomly as he tossed and turned. Even if it was intentional there could be many reasons for it and all of them are harmless. It's not interfering with his sleep, it's not physically hurting him, it won't make his penis fall off. Really it's not a big deal.
If your concern is that he is masturbating I don't think this description alone proves that, but frankly it wouldn't matter if he was. Masturbation does happen in kids that age often enough. It's well known and documented. It's also known that it doesn't harm a child, at that young an age it's not even an attempt at achieving orgasm usually, it's as much for comfort as sexual gratification.
Every child psychologist or expert in child development will say the same thing, even if your child was masturbating it is normal and harmless. In fact experts agree more harm comes from parent's overreacting to a child touching themselves then to the contact itself. Other then teaching a child such touching should be done in private, and redirecting him if he is actively doing it in a public location, it's best to just ignore it and let the kid figure things out for himself.
I see from your comment you are worried because you were molested as a child (and I'm sorry about that). Perhaps that implies you are worried that this is a sign of molestation? if so please don't worry, it's quite common in children and nothing bad would have had to happen to your child for him to enjoy touching himself, assuming that was even what was happening. This is not considered an indicator of molestation or child abuse.
Just relax, there is nothing to worry about here.