writeIndex update fix + buffer bounds check fix + empty channel buffer test fix

* Make sure that `AbstractChannelBuffer#writeByte(int)` doesn't increment `writerIndex` if write was out of bounds.

* Add bounds checking to `AbstractChannelBuffer#bytesBefore`

* Make empty channel buffer tests run properly, fix failing tests and assert invariants after each test.