[test] Move utility functions into reusable CMake file.
Some pieces of the main CMakeLists.txt file are useful to future
CMakeLists.txt. In order to avoid duplication, move those pieces into a
new SwiftTestsUtils.cmake to be able to include the functions from other
files.
This should not modify anything in the behaviour of the build.