Minor updates to copperegg-agent.rb to harden it against rare network communication failures.