Make themes_on_rails thread-safe by not modifying the controller class on every request

This should not have any difference on MRI since it as a GIL, but would impact parallelised implementations like jRuby and Rubinius.

Furthermore, this helps with inherited layouts, since if a layout is defined via a Proc, it does not allow overriding by subclasses.

Makes working with gems like [High Voltage](/thoughtbot/high_voltage) possible since they also override `layout`.