close sockets when they are garbage collected (see #3)