Make puppet-agent-check more robust

Closes https://github.com/cargomedia/puppet-packages/issues/629