libcephsqlite: register atexit handler for cleanup
We need to tear down the ceph vfs when sqlite3 (or other binaries) call
exit(). Otherwise global state gets destructed which can cause library
threads to segfault or raise exceptions.
Also pull vfs struct out of appdata. We need to be able to detect double
calls to the atexit handler which, sadly, can happen.
Fixes: https://tracker.ceph.com/issues/50503 Fixes: https://tracker.ceph.com/issues/51372 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>