XHRLoader: Fixed loadmanager/cache potential bugs. See #4819.