use php_imagick_throw_exception when passing a constant

I'm trying to compile your extension for HHVM which is written in C++. It mostly compiles in C++ except for a few cast requirements which I'm ignoring. These were the only blatant errors the typechecker found.