Fixed listeners sometimes being called twice when socket connection is lost (eg. NodeCG restart)