Handle possible integer overflow in FastByteArrayOutputStream.

patch by Mikhail Stepura; reviewed by Jonathan Ellis for CASSANDRA-7373