[kokoro] Extract xcode-select logic to a method. (#4962)
[kokoro] Extract xcode-select logic to a method. (#4962)

We'll be reusing this logic for other jobs in the future.

I also simplified the logic to remove duplication-checking because we just care to select the first version of Xcode that matches our desired version.
material-components/material-components-ios,material-components/material-components-ios,material-components/material-components-ios,material-components/material-components-ios,material-components/material-components-ios