change calculation method of GD memory usage in check_memory4gd()

ref. http://sakamocchi.jp/item/277 by Mocchi