Add Matlab helper function to convert matrix into byte array (rebased onto dev_4_4)



This is the same as gh-1729 but rebased onto dev_4_4.

----

- 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