application: Dispose contact store on window destroy

Merged Marcus Lundblad requested to merge wip/mlundblad/unref-contact-store into main

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.

Fixes #454 (closed)

Merge request reports