Fixes #3860 - automated discovery provisioning

Replaces https://github.com/theforeman/foreman_discovery/pull/97
> Why use a transaction here? What are we trying to protect?

Find and apply must be done in one transaction, otherwise we can
provision something twice.

-- 
Later,
 Lukas #lzap Zapletal