Ensure the ImapDB.Database garbage collector exits in close_async

The gc will prevent unit tests from completing and hence causing
timeouts, so ensure it finishes before returning when closing the db.
7 jobs for wip/imap-db-acccount-test-flakey in 19 minutes and 39 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #193511
fedora

00:09:26

passed #193512
ubuntu

00:11:42

 
  Test
passed #193513
deb-package

00:03:13

failed #193630
flatpak

00:04:43

failed #193514
flatpak

00:04:08

 
  Deploy
skipped #193515
review
skipped #193516
allowed to fail manual
stop_review
 
Name Stage Failure
failed
flatpak Test

Full log written to /builds/GNOME/geary/_build/meson-logs/testlog.txt
A connection to the bus can't be made
Uploading artifacts...
WARNING: geary-dev.flatpak: no matching files
_build/meson-logs/meson-log.txt: found 1 matching files

_build/meson-logs/testlog.txt: found 1 matching files

Uploading artifacts to coordinator... ok
id=193630 responseStatus=201 Created token=zwcZy5ki
ERROR: Job failed: exit code 1