Move whole checkout method into sync block
Fixe issues where sometimes the passed in session is set to nil.
This is mainly caused by nested .with_session calls, but I have seen it under certain circumstances elsewhere
Get rid of session_for_thread
Clean up creation of session_pool a little bit.  Use Threadsafe::Cache instead of Hash