[FLINK-1327] [core] Fix wrapping of MemorySegments in ByteBuffers