fixed the upgrade agent to not crash under circumstances where the blitsme agent is closing while the upgrade is taking place.