Fix gmagick memory leak

We need to unset gmagick instance to free memory. And unset layers instance because it contains reference to gmagick too.
I don't want to introduce the memory management in the API. We use PHP because we don't want to handle this.

The probleme with gmagick is that it suffers from so much bugs that aren't closed (the related bug report 1 year and half old), I think we probably ignore such segfault in this implementation.

I'm okay to deal with bugs, but we're dealing with so much special case...

Definitely, GD and Imagick are stable enough to provide support.