Fix mysterious build segfaults caused by build directory virtualization.

Build directory virtualization changed the build directory into a symlink and
relocated the SCons signature cache into cache/$branchname/sconsign.dblite. This
causes strange issues with SCons (and I should have listened to asantoni's
warning comment from 2008. I thought maybe the problems had been related to our
previous build system setup but it appears there is a bug in SCons).

This new method keeps each branch build directory and .sconsign.dblite file in
cache/$branchname/ as before. When you run scons in a particular branch, it
moves the build directory and .sconsign.dblite file to the root and writes a
.sconsign.branch file to keep track of the branch the files are related to.

If you run scons and the .sconsign.branch file does not match the current
branch, the build system moves the current build directory and .sconsign.dblite
file into cache/$oldbranchname/ before moving the data from cache/$branchname/
to the root.

I could reliably reproduce the segfault caused by the symlinking by starting at
SHA f47eca6c, building, and then merging up to SHA 82c4a75 and building. The
resulting binary would segfault on start. This patch fixes the segfault.