I agree with Kilokahn. I sleep with my legs folded because it's comfortable that way and I'm somewhat of an insomniac. During the first 2 months, I was only able to sleep for 3-4 hours a day. So I had to find a comfortable position to sleep properly.
But if you want to do the right thing, then sleep with your legs fully extended.