shmem: Fix deadlock when System is low on memory