Ignore exceptions from template compilation on background threads

Fixes issue #546 by swallowing template compilation exceptions occurring on background threads.