Ensure logged binary data is fully written

The write() syscall doesn't guarantee that all the data it is asked to
write will be written in one call.  This rendered one player's game
unrecoverable, due one of the NetHack4-style save diffs early in the log
failing to be fully written, causing every subsequent diff to be utterly
useless for recovery purposes.

This is meant to go with commit 5ed947abac (fix bones file handling) and
commit 86bb075297 (NH4: store game state diffs in logs and saves).

This bug also exists in upstream NitroHack and NetHack4.