Fix certdirectory tests leaking temp directories.