I also think this is an iOS 4.0 issue. Today, i was using my 3gs and had similar problems as everyone here. I never had these problems prior to upgrading to iOS 4.0. Maybe they tweaked the software and made it a little too sensitive?
I think that is exactly right. It now seems like it registers even the slightest movement as being pulled away from your ear and turns the screen on. If this is indeed the case that is good news since they should be able to easily fix it with an update.