Worked around bug #261 again. Added sleep for EAGAIN case