Move failure management internals from boolean to an error variable,
so we can relay that back to the caller (and an http daemon can handle
broken pipes, for instance)

This doesn't warrant a mutex, as we don't really care if the last error
wins, just that we *do* have an error somewhere.