Tentative fix for #3174

This wraps the generation of git gem binstubs in the same exclusive lock
that is used by installing threads. Since generating binstubs _also_
generates the entire gem, it seems like there were install threads
stepping on each other while writing the gem itself and while writing
the gem to add the binstubs.

Ultimately, I think we should stop writing out all the files for each
gem twice, which seems to be what is happening here. It’s more important
to fix the exceptions first, though. :)
apply chdir monitor to all chdirs

Now that MRI and Rubinius also use the threaded installation plan, we
need to make sure that all installation threads will stay synchronized
and not cross-access files.
Fixed an issue with building git gems in parallel

We need to ensure that the dir remains the same
through out the installation of these gems,
this includes Path Installer as well as rubygems
build.
||= is not thread safe
raise AuthenticationRequiredError on Net::HTTPForbidden
Merge pull request #3262 from arronmabrey/use_api_auth-1-7-stable

raise AuthenticationRequiredError on Net::HTTPForbidden
Run all tests against RG master again

Conflicts:
	spec/spec_helper.rb
guarantee Bundler.settings will only parse once
replace newlines and/or spaces with one space
add a test for duplicating quotes
ensure quotes will not duplicate during YAML.dump

closes #3261
adjust spec to values that actually cause quoting
:space_invader:
limit quote-doubling spec to 2.1

YAML only adds quotes to values starting in Ruby 2.1, so testing this
on earlier versions of Ruby seems silly.
So that didn't actually work. Ugh. Try again.
Version 1.7.7 with changelog
A fix for issues #3089, #3216 and #3248

Currently Bundler is aggressive to try different
versions of exsiting gem parents before
exhausting different versions of parents of
current conflicting gem.

By making sure we travase the current conflicting
dependency tree before trying to make use of exsiting
(activated) gem dependency tree, we reduce the number of
conflicts and activation of gems older then the latest
compitable version.

However, a long term solution would be to make the resolver smarter
by making it understand if current requirement conflict is caused by
either by it's parent or existing gem parent by looking at each of their
dependency requirements.
Fixes issue #3059

Currently Bundler tries different versions
of current gem and than it's parents and finally
existing gems.

However, when trying different versions of current gem
will cause it to conflict with existing gem version and
sometimes it will be unable to resolve the dependency tree
correctly.

Now, we will try to resolve current gems parent first then
current gem and then finally the exisiting gems.
Don't waste iterations in resolving Bundler, just use the current version
Add specs to check edgecases for the resolver