A workaround for the MySQL "Lost Connection during query", or any other object related problems caused by children exiting is to force the child to kill -9 itself, thus avoiding any cleanup. Sure - it's not too elegant, but it does work.
<?php
$pid = pcntl_fork();
if ( $pid == 0 ) {
// This is the child process. Do something here.
// Instead of calling exit(), we use posix_kill()
posix_kill(getmypid(),9);
}
?>
Watch out that you don't spawn too many processes though as this creates its own problems.