XGetSubImage: improve efficiency by reducing number of temporary heap allocations
Fixes #114
The previous implementation of XGetSubImage put the result of XGetImage in a temporary image for the sole purpose of copying its data over to dest_image. This is very slow and with these changes, X11 will directly copy from the X server to the dest_image->data buffer as long as the formats match.