Changed name of db for pure valgrind tests (< 10 characters). A leak fixed

### Description
The name of the database for 'pure' valgrind tests was valgrindtest.
After changing the max length of db name to 10 characters this test stopped working,
Changed the database name to 'leaktest'.

Running the pure valgrind tests I ran into a leak, so the leak is fixed also in this PR.