Avoid allocations in critical sections.

If a palloc in a critical section fails, it becomes a PANIC.