build: fix 'make distcheck'

Rather than treating the .py as a regular built test, run it from check-local
so that we can better control the paths used.
Merge pull request #5514

be43492 build: fix 'make distcheck' (Cory Fields)