action_reposync/yum_sync - honor mirror_locally

With mirror_locally false, yum_sync should write the .repo file and
nothing else, but this was broken by commit ed49c900.

Refector the routine to write out the local config file up front,
making the logic cleaner.
Merge pull request #1316 from mark987/yum_sync2

action_reposync/yum_sync - honor mirror_locally