Add overwrite functions which do not zero bytes.

In several places bits are overwritten in the bitstream. These
functions avoid zeroing bytes during writing so that this can
happen correctly when the number of bits is not 8*N.

Re-addresses the attempted fix in
133c57c331f3b1806233fbd83db1f5f022b1490a

which broke threaded encoding tests, which relied on re-using
byte buffers.

Change-Id: I682c5e3a7869eac7ad475584db8bf170d47a56c9
3 files changed