Appenginefixes

i think this is uncontroversial stuff. i'm just catching the security exception and logging a warning.

appengine has an API to register shutdown hooks but i don't think we want to do a "if (isDeployedOnAppengine)..."