Set proper permissions for acceptance tests in "make dist" tarball.
Fix segfault when fopen() fails.
Include tests/unit/data/ recursively in dist tarball.

The previous EXTRA_DIST wildcard hack didn't work as expected so
for now just include the whole subtree.