backend: fix NPE when quitting