Modify TemplateRenderer to use ThrowIfFaulted instead of Task.Wait

Fixes #782
you can also just use `TaskCompletionSource` here - then you don't have any actual threading or race conditions, but you can still control the behavior.