make a nicer exit from script on unexpected socket closes