Fixed crash in case the write_headers throws, closing bug #3370576
Authored by: artyom-beilis 2011-07-31
Parent: [r1894]
Child: [r1896]