[cmake] Skip regex when CMAKE_STATIC_LIBRARY_PREFIX is empty.
[cmake] Skip regex when CMAKE_STATIC_LIBRARY_PREFIX is empty.

In platforms like Windows, there's no prefix for static libraries.
Interpolating it in the regex will end up with a regex "^", which seems
not to be valid. Since the regex was removing the prefix, we can simply
skip the operation and the result will be the same.

Also do the same for CMAKE_STATIC_LIBRARY_SUFFIX, even if in that case,
Windows will have a value (but if it is empty, it will fail trying to
create the regex).

apple/swift-corelibs-xctest,apple/swift-corelibs-xctest