Add Matlab helper function to convert matrix into byte array

- Add new `toByteArray()` helper function to the OMERO.matlab toolbox (replace deprecated `GatewayUtils.convertClientToServer()` function
- Add corresponding unit tests
- Update `CreateImage` example to use the new function and upload a synthetic image with a gradient along X spanning the entire range given by the pixel type

Fixes https://trac.openmicroscopy.org.uk/ome/ticket/11624

/cc @imunro, @yalexand, @mporter-gre