Print file descriptor of a socket error condition only if non-null