writer: simplify io.writer use

io.Writer.Writer must write all bytes when no error is returned
writer: remove error checking

* bits <= 32 is an API expectation
* skip error checking as writes are already disabled
writer: add Write64Bits which write up to 64 bits
writer: remove uneeded index check during flush
writer: fix and add tests against two potential bugs

Fix overflow during flush when w.fill > len(w.data[w.index:])*8
Fix overflow during writes when w.data is smaller than CacheSize