Show profiling data on preview

Change Ie065c7b5 added profiling data at the bottom of preview pages.
This adds the same data to TemplateSandbox previews.

Note this will work correctly even in the absence of that change to
core, as it checks for the new function's existence before calling it.

Change-Id: Id653cd18ab9070fab4ad0c50cb976a6f64235b47