Fix bug caused by accepting closed connections

As mentioned in the [asyncore docs][1] the accept method could return `None`, in which case the connection should be ignored.

[1]: http://docs.python.org/2/library/asyncore.html#asyncore.dispatcher.accept