Flush file output in debug task if Agent isn't running.

This causes the file to be created even if the Agent couldn't start for
some reason, such as when the --platform option wasn't passed.