Fix memory leak in ImageList#optimize_layers (#359)
Fix memory leak in ImageList#optimize_layers (#359)

If empty image list was given, `images_from_imagelist()` will raise exception.
Then, memory area allocated by `AcquireExceptionInfo()` causes memory leak.

* Before

```
$ ruby optimize_layers.rb
Process: 16589: RSS = 388 MB
```

* After

```
$ ruby optimize_layers.rb
Process: 17735: RSS = 16 MB
```

* Test code

```ruby
require 'rmagick'

list = Magick::ImageList.new

1000000.times do
  begin
    list.optimize_layers(Magick::CompareAnyLayer)
  rescue
  end
end

GC.start
rss = `ps -o rss= -p #{Process.pid}`.to_i / 1024
puts "Process: #{Process.pid}: RSS = #{rss} MB"
```
rmagick/rmagick,rmagick/rmagick,rmagick/rmagick