You can cause KSnapshot to exit by using exit, as shown below.
exit
$ dcop ksnapshot-23151 interface exit
$