Fix output file cut-off issue

Fixes: https://github.com/dtabuenc/karma-html-reporter/issues/1

Since it was listening to the template end event instead of the write stream finish event, it could exist before the last file finished writing, leaving it cut off.