Fsevents backport

Backport of recent fixes.

@bnoordhuis, sorry it seemed to be a bit complicated to backport it without your on-demand threading commit. Also, I thought that v0.10 and master will diverse even more if I'd adopt changes without your commit. So, I decided to pull it into with your changes.

Please review.