shell/caucase.sh: Improve built-in test suite.
Simplify code a bit. Change directory when starting caucased, so all files are stored inside test's temporary directory (and not just the database). Tolerate caucased not immediately starting. Fix CA presence tests (well this is embarrassing). List test directory content when failing, as it will get deleted shortly after.