fchdir: avoid memory leak on re-registration.