Backport a patch similar to r580433, but similar to the apr-1.2 specific server/log.c r602467, take into account the fact that apr's flags could not be adjusted. Backports: 2.2.x branch r607311