Add try-dequeue function.