pending() and receive() now handle closed ports correctly.