Segfault fix for more than one modules

This bug has first reported on 2004 but was never fixed (http://marc.info/?l=php-internals&m=110257814320454&w=2). It has since then be raised several times (https://bugs.php.net/bug.php?id=63159 http://marc.info/?l=php-internals&m=110121150631159&w=2 http://marc.info/?l=php-internals&m=110332550012837&w=2). Let's see if we can fix it once and for all.