Reduce scope of CHDIR_MUTEX

As multiple extensions can't be built in parallel by bundler (the API of
Gem::Installer does not allow it) there is no need to include @ran_rake
in the mutex.

Updates #607 to match the 2.0 branch.