maven-helper.sh: teach it about thirdparty repos

When calling "maven-helper.sh latest-version x:y", the releases
repository prefix was always used. So when querying the version of a
3rd-party artifact such as org.apache.maven.plugins:nar-maven-plugin,
the command failed.

This change first checks the HTTP response header of the GAV within the
releases repository; if it not successful (i.e., code 200), then it
falls back to the thirdparty repository instead.