tor-hsservice: replay: Recover from partial writes
Fixes #1207 (closed)
Most of the effort here was in the test case, which is quite a contraption.
I discovered that the issue is theoretical - it doesn't occur with the current implementation of BufWriter. I still think we should have the test case, at least.
If, in the future, BufWriter documents the extra guarantee, we could revert "tor-hsservice: replay: Recover from partial writes".