configure: kill puppet agent at each step

It happens Puppet Agent is already running and it blocks the loop
because there is no return.
So this patch aims to ensure Puppet Agent is not running before running
it.