move the check_if_fd lock-taking up into the caller.