Fix a rare crash in get_serialize_type

If get_serialize_type gets called without a proper environ,
it throws an uncaught KeyError, crashing the request to 500
(or worse).

When might this happen? When a piece of middleware (e.g. dozer) is
injected at the start of the middleware stack.
pyflakes suggested tidy up
release 1.4.9
Merge branch 'master' of github.com:tiddlyweb/tiddlyweb