I think with the API there is not way to do this directly. But calling "ksession.dispose()" should finish the actual session and delete process instances which are not needed any more.
For the tables you mention, it does not seems to be JBPM5. I think in JBPM5 the process runtime is deleted from db when the process is completed.
If you are using jbpm3, this api should help: