enqueueWriteImage: convert origin/region to 3d arrays for OpenCL call

I think I've got a fix for the INVALID_VALUE exception in enqueueWriteImage
https://github.com/toaarnio/webcl-firefox/issues/48