Check the class of the $content object when getting restricted templates.

Fixes a bug that effectively made it impossible for users without the tpc-restricted right to create any new pages, since PHP would throw a fatal error when trying to call getNativeData(). Whoops.