Go to the top-level source dir before doing anything that requires writing

This will help avoid confusing git if it's cd'ed to a path, do a checkout
of the directory, and the path disappears :o..