Fix a bug in converting ByteBuffers

The conversions for ByteBuffer -> byte array and seq-of ByteBuffer -> ByteBuffer incorrectly modifies the buffer's position.  This fixes the issue and adds a test that fails without the fix.