Stop crashing on exit when being used solely as a KPart (upstream cd8ad276)