Pthreads calls return errors in the result, not errno
If the watched_fd handler returns 0, delete the pollfd

If the handler returned 0, we would not delete the pollfd, and so
pass it to ppoll and get confusing results.  Fixing this involved a big
overhall of poll.c, but it is a lot more straightforward now.
Fix connection deadlock

Using tasklet_later without holding the tasket lock is a bad idea.
Fix race in application.c