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 213625c.

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

action_reposync/yum_sync - honor mirror_locally