Use the "Gravity Screen" app, it turns off your screen when 1) the phone is upside down and 2) when the proximity sensor is covered (for my phone, I can do this by holding my phone upside down and covering the front camera). There are more special settings in the app, but that's the basics...