Moved write cache before sending to master. This allows for the master to go down during a job but the minion will still have the job data
Merge pull request #11780 from replicant0wnz/cache-job-before-send

Moved write cache before sending to master.