fix struct decl that was not C99 compatible
Reorg of test cases
fix some cases of incorrect handling of sec non-unique keys
fix integrity checking for test cases
fix misc memory leaks
file descriptor leak
leak.
additional concurrent test cases
Add interleaved test case