Fix several swap page use problems

I was able to put a number of keys exceeding the memory size with these
fixes. The swap file is now created on demand.
Free new dirname field in keydir
Fix issue with keydir registration

And removed a bunch of now obsolete tests. Funny how many of them dealt
with frozen keydirs and the old weird iterator semantics.