5d4fa194b8
rsc->write_batch can be cleared behind our back, so we need to acquire the lock *before* deref'ing. Signed-off-by: Rob Clark <robdclark@gmail.com>