Refactor ContextWriter

Pulling comment out of PR #5066 so we don’t forget:

ContextWriter is currently a pretty strange construct. I went to dig in to see where it was actually writing, and the answer is nowhere. So the multi writer used in a few places and the context writer is actually just a way to stop if the context errors, which isn’t clear looking here.

It would be more expectable if the ContextWriter itself took the extra writer (hasher in this case), and passed the write through until it was closed. Then someone passing by would guess correctly that:

osutil.ContextWriter(ctx, hasher)

writes through until EOF or the context is done.

(cc @chipaca)

yep, I’m not going to do that while there are in-review branches that use it though, to avoid conflicts.

Completely fair. Moved here precisely because it makes sense to not be blocked, so just trying to not lose the idea.