Fix the race conditions in ProcessingNode and SinkNode
*Previous Version: The isLast() method is introduced to end the while
loop in ProcessRunnable and ReceiveRunnable seperately, which also
indicates the upstream has finished sending data. This situation is not
handled in the cleanup and is regarded as being killed(stop flow) from
Node.