Fix some more environment class bugs

This patch makes config caching finally work across requests by moving the
cache to MWParserEnvironment.prototype.

Another fix makes sure that template fetch requests don't leak across
top-level requests.

Change-Id: Iea67d455c6f598eba5247fcf6b0af1f95e72a37b