Synchronously wait for render only for tests

Dont wait for all pipelines to finish rendering to composite unless
outputting the result to a file.
Note Compositing will be racy with rendering.

Minor whitespace cleanup