Update codequality job's function and rename ENV VAR for Security Products versioning
This changes is necessary to fix the regression introduces by the previous modification of the code quality job. See https://gitlab.com/gitlab-org/gitlab-ce/issues/44340