stream: release the callback if .write()/.end() throws