cursor: Don't free the image if it hasn't loaded

Otherwise, we'll try to free a null image and crash.