Make the LevelDB API more resilient to invalid configurations.  Also clean up after the test so that "make check" has a better chance of succeeding.