Prevent unchecked memory access in cut_surface()

The result of create_compatible_surface() may be encapsulating a null
pointer whenever the underlying call to SDL_CreateRGBSurface() fails --
in particular, if the width or height specified are negative and not
equal to -1, which is handled specially.

Without this check, using the ~CROP(x,y,w,h) image function with
negative width or height not equal to -1 resulted in a SIGSEGV as soon
as the create_compatible_surface() result was used.