As discussed on IRC, this is not the right approach.  I'm assuming you do this to clean up the poller and the readdir req, right?

IMO, the best way to address this is by postponing closing the uv_fs_event_t handle until the poller and the readdir req have closed and finished respectively.

Right now, that's not possible but it should be reasonably straightforward to implement.  When you do, you can fix up src/fs-poll.c while you're at it.  :-)