Fixed segfault and ZTS build

do not use add_constant_long, use zend_declare_class_constant*.. in recent PHP, it alloc a zval_gc_info for item, not zval..   this may cause segfault in some case..

then I fixed the ZTS build


thanks