Log failed writes to $log.error

If the server responds to a resource write with a 400-class error code,
we drop the resource instance from the write queue because we assume
that there is something wrong with the request. Previously, when we did
this we were not logging the error, now we are!