PDI-10641 correctly handle row execution

* clean up cached results of execution when each row is passed to row executor
* refactor the code to allow unit testing
+ add unit test