add code to prevent broken xcode-select link, fix #2313