Add close event handler for write stream in node v0.8 case