Change middleware insert order to work with config.threadsafe!

I made this change in order to make font_assets work when running in threadsafe mode (which cannot insert before Rack::Lock because Rack::Lock is not in the middleware stack in threadsafe mode).