Don't use deprecated $app->getCfg for the plugins folder

### What this PR do
This PR remove the deprecated usage of:
JFactory::getApplication()->getCfg()
from the plugins folder.
Also this improve a bit the usage of $app for the Debug Plugin.

### How To test

Please make sure that the following system plugins still works as bevor:
* Cache
* Debug
* Languagefilter
* Sef

### Tracker
JC Tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33694&start=0