Fix issues with XCache cache handler

Fix issues with XCache cache handler when it is enabled in the Joomla! Global Configuration but not available on the hosting environment.

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=20476
Cleaned up using phpcs and proper formatting (mainly newlines)
Merge pull request #3878 from yireo/patch-3

[#20476] Fix issues with XCache cache handler