Still guess an ID always, but only cache if it's a proper minion

Fix #8052
Fix #8050
Merge pull request #8055 from basepi/minionidcaching8052

Still guess an ID always, but only cache if it's a proper minion