Add env information to NullSession, fix session tests in railties