This has annoyed me for years. Now that Apple has fixed all the major annoyances like copy/paste and MMS, I think it's time for us to start pushing this fix. Here are some creative ways I have thought up to keep the screen from flipping to landscape when you're lying down:
1. Add the option that if you hold two fingers on the screen while you rotate it, the phone will keep from rotating the screen.
2. Add a "Disable accelerometer" option in Settings.
3. Add the option that double clicking the home button manually rotates the screen the opposite way the accelerometer is telling it to rotate.
Please
click here to go to Apple's iPhone feature request page and request this fix.