This backports e2f6859729,
which works around perl issue https://github.com/Perl/perl5/issues/17570
MySQL fix ensures that FILE_APPEND_DATA is used in redirected
stdout/stderr open flags, rather than FILE_GENERIC_WRITE. Only this gives
lossless append behavior, if multiple processes use the same file.