SF build: Move editing step to before chmod step

It seems that editing files is resetting their permissions, in
particular the +x permission bit on the use*Config.sh scripts. Moving
the editing of those files to *before* the chmod step should take care
of that problem.