Clear out ThreadLocal state at the start of each HTTP request.

This is to prevent the retention of stale data in environments where there is a thread pool for
HTTP requests, as is common. The recommended alternative is to shove your shit into the HTTP
request context, but that's all untyped and shitty. ThreadLocals are much nicer, so we just need
to do a little legwork to make them better in this environment.
Do the reset at the end of the request instead of beginning.

This way, an idle request thread has freed up resources for GC instead of holding on to them
forever.