ashmem: avoid deadlock between read and mmap calls