exit from a child thread so it gets cleaned up

Otherwise we are unable to fork (ENOMEM) several times in a row.