Trying to add includes from the PECL memcached extension I modified with nearly the same code.  Hopefully that's what's causing this segfault.