Ensure that the target file has been properly flushed before exit

It seems this patch fixes the https://github.com/azproduction/grunt-lmd/issues/4 for me on Ubuntu.