Prevent Template apocalypse

When Ia0c5c8ec960aa6dff12c9626cee41ae9a3286b76 gets merged in
mediawiki-core, how templates work will change completely. This saves
the day and stops Flow and MobileFrontend breaking when that happens.

Change-Id: I0554332e896b51956adc7cb26681038cfe7830a1