[imp] Improve the "Is debug" check for the templates

### Tracker

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33869&start=0

### How to test
1. enable debug
2. make sure that the debug css is load if debug is on for all templates.