job file: fsync to file system before close

Flush and fsync job file to file system before close. This is an attempt
to prevent this type of error (seen on virtual machines) when we execute
the job file:
```
/bin/bash: SCRIPT: /bin/bash: bad interpreter: Text file busy
```