Fix minion ID caching for minions using non-default root_dir

Caught this in my testing since I run my development testing in
virtuialenvs and need to use the root_dir option.

This commit uses the root_dir minion option when deriving a location for
the minion ID cache file. It also cleans up some stuff that drives
pylint crazy like single-letter variable names, and generic exception
catching in try/except.
Merge pull request #7723 from terminalmage/minion-id-caching-fix

Fix minion ID caching for minions using non-default root_dir