tests: Fix cleaning up after tests

Some of the test failed, because files (eg. mountpoint) were removed before
killing all the processes spawned by the tests. This commit makes the tests
kill all the processes first and then remove all the files.