Fix too lenient ref wildcard matcher
As discovered in
https://gitlab.com/gitlab-org/gitlab-ee/issues/9407#note_154754244, a
wildcard pattern *-stable
would match 1-2-stable-test
, when it
should not.
The CE implementation had the right regexp anchors, but in trying to improve the Gitaly implementation we inadvertently dropped them.