Initialize wgResourceModules early; improve cache handling

* the BootstrapManager expects initialized $wgResourceModules, so they need to be -as far
  as possible- initialized early to avoid errors from calls in LocalSettings
* the cache needs to be purged in case of a LESS compiler error

Change-Id: I52655511ad758e23deec46c5f0550a2f785e8154