chdir() after chroot()ing.

We currently do not support chrooting so the code is never invoked,
but not chdir()'ing after chroot() can result in a security vulnerability,
so I'll add the chdir() code anyway to prevent future mistakes. Thanks
to darix for reporting this.