Use system.getHostname() everywhere
Replace os.environ['HTTP_HOST'] with system.getHostname(), as a
result we do not crash when 'HTTP_HOST' is unset now.
A list of bugs is available in the Google App Engine SDK project on Google Code.The issue tracker is at http://code.google.com/p/googleappengine/issues/.