build: fix 'make distcheck'

Rather than treating the .py as a regularly built test, run it from check-local
so that we can better control the paths used.

Fixes "make distcheck" since it's now able to find the environment vars.