On connections where it applies, signal to the peer connection that the
connection is shutting down/half closed, and only fully close once both
sides are complete.
If a client program receives the fd then it is responsible for closing
the fd, and we must not close the fd, as we may end up closing the wrong
object.
This was compiling because of the implicit integer conversion on the C
side. But -1 was becoming INT32MAX. Which was an invalid fd, so the logs
were hidden just as if the fd were -1. But it filled strace with EBADF.
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>