Fix asynch I/O race condition.