PUP-3656 Prefetch only rescue LoadError or MissingCommand

Currently prefetch rescue all StandardError, and this results in puppet
creating resources unecessarily when prefetch fails. This patch limits
the exception handling to only rescue LoadError for rubygems, and
Puppet::MissingCommand when software packages have not been installed
yet.