Close socket on drop DTR to allow disconnect

Also add checks to ensure EleNorm functions are not called after the
socket has been closed, or if the socket has no "carrier"