application: Dispose contact store on window destroy

When quitting through closing the window, the contact
store is disposed in the final GJS GC sweep, which
seems to cause some race condition with respect to
the main loop.
As a workaround to this, manually dispose the store
in this callback, and set it to null.
Also guard some calls involving contact store with
nullish checks to avoid possible use-after-free.
1 job for wip/mlundblad/unref-contact-store in 11 minutes and 44 seconds (queued for 1 minute and 14 seconds)