Close the root directory on forks to allow chroot(2) to work

This fixes linux packages (calling chroot ldconfig)