Fix gmagick memory leak

We need to unset gmagick instance to free memory. And unset layers instance because it contains reference to gmagick too.
right! if you have long-running script, that processes many images, you should call destroyGmagick. it is not so handy, but you do not get segmentation fault and do not let gmagick eat all memory