client: fix write_req leak