Added c.end when an agent disconnects, otherwise this will lead to an huge amount of CLOSE_WAIT connection states, so to "too many open files"