resourceloader: Add ResourceLoaderContext::getUserObj and replace use of $wgUser

Introduces ResourceLoaderContext::getUserObj(), which gets
a (possibly cached) User object for the context's username.

Use this instead of the $wgUser global.

Change-Id: Ifd9f634db145381625ab68067ae67791a3f494b8
Merge "resourceloader: Add ResourceLoaderContext::getUserObj and replace use of $wgUser"