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 a cleaner.