tdb2: use failtest for opening and checking database.
This is a fairly sophisticated use of failtest:
1) There are a few places where we can inject failures without revealing it
at the API level, eg. opening /dev/urandom, or allocation failure in logging.
2) We want to be sure that (almost) all failures cause a message to be logged.
3) We need to exit as soon as possible when a failure is injected, to avoid
combinatorial explosion.
4) We don't want to simply exit on any log message, since we want to be sure
that cleanup happens.
This test found four different bugs failure paths. Erk!