Fixed deprecated regex modifier e by replacing it with preg_replace_callback()
Fixed headers sent exception in ResponseFlushTest