(#1245) Use tmp directory for test dbs and remove it afterwards.

Instead of the temporary databases being created in the repository base they are created in './tmp'