wrap: use shared function to connect to wrapdb with better errors
wrap: use shared function to connect to wrapdb with better errors

We currently inconsistently handle connection, `has_ssl`, and printing
errors on urlopen failure between `meson subprojects` and `meson wrap`.

Make the latter work more like the former.

pexip/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,pexip/meson,pexip/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,pexip/meson,pexip/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson