Bug 842434 - Ensure the flows of handling "socket disconnection" are the same, r=qdot

For "actively calling CloseSocket()" and "passively noticing the socket has been closed",
we want to ensure that the process of closing a socket are the same. Therefore I use a
runnable to call CloseSocket() on the main thread when it can't read from the socket.