When running unittests don't write to outside the build dir.

This fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743108
Merge pull request #314 from TheTorProject/fix/debian/743108

When running unittests don't write to outside the build dir.