Do not assert on disconnect(NULL)

Match the behavior of free() and allow NULL pointers in the disconnect
function. This can make error handling code slightly simpler, and
there's really no problem if we try to close a connection which failed
to open.