Add a test to ensure that req.write() and req.flush() do not leak memory (2.4 only)