Fix regression in minion ID caching

Some changes meant to fix minion ID caching in Windows caused a
regression in caching on *NIX OSes. This commit fixes that regression,
making minion ID caching work for all platforms.
Merge pull request #8324 from terminalmage/minion-id-caching-fix

Fix regression in minion ID caching