Don't sleep when out of memory

Instead, simply drain the output buffers, and retry.
This improves performance immensly when reaching this
condition.