Fixed various race conditions which could occur during parallel installs. Open toolchains-file with write access also on commands that only read the file (as this is more correct with respect to the file-lock).