Revert "lock the selfpipe to avoid spin-lock"

This reverts commit 4c23432cc270554557f9e130331214d81164131b.

I'll provide a different solution.
IMAP: replace self-pipe event with a timeout event