gitlab_runner: Make the authentication script more portable
Relying on bash's regex extensions was a bad idea, since the environment this script runs in can be just about any container. For common cases like alpine containers, that means no bash by default.
Rely instead on sh and grep for regex matching.