repository_spec: fix tmpdir location

Discovered this because I had /tmp/foobar created by root on my local
system for some unrelated tests. :-)
Handle invalid JSON data files