http: fix `http.ClientRequest#write` callback arg

If you pass in a callback as third argument to the `write` or the `end`
function on `http.ClientRequest`, it is ignored today. In some cases,
when the callback is passed as the second argument, it may not call it.

Fixes #5729