Fix HelperAgent graceful exit. It wasn't correctly detecting the situation in which all clients have disconnected for 5 seconds.