Prevent registering on a closed selector. Fixes #27

I had the same crash as in #27, this pull-request fixes it.