Fixed: partition state memory is not released while processing foreachStream
query in stream-by-stream mode