buaazp: fixed runtime error #35 a thread_safe error when imagemagick version >= 6.8.9-8