Out of memory message should not allocate memory.
This fixes [perl #40595]. When Perl_malloc reports an out of
memory error, it should not make calls to PerlIO functions that
may turn around and allocate memory using Perl_malloc. A simple
write() should be ok, though. Inspired by S_write_no_mem() from
util.c. Also replaces the local write2 function, which did the
same thing slightly differently.
Under -DDEBUGGING, there are other calls to PerlIO_printf that are
also likely unsafe, but that problem is not addressed here.