DRILL-1813: Fix race condition in UnlimitedRawBatchBuffer

Also change propagated exception to IOException instead of RuntimeException.