lspclient: avoid segfault on restart

Merged Mark Nauwelaerts requested to merge work/lsp_no_restart_crash into master

Merge request reports