[WIP] [Process] Added support for stdout and stderr flush (Issue #7884)

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7884
| License       | MIT
| Doc PR        | pending

**To-do**
- [ ] submit changes to the documentation.

This PR introduces flushing methods for both stdout and stderr on Process class. The new methods are:
- flushOutput(): clears the output buffer.
- getAndFlushOutput(): returns the output buffer and then clears.
- getAndFlushIncrementalOutput(): return incremental output and then clears.
- flushErrorOutput(): clears the error output buffer.
- getAndFlushErrorOutput(): returns the error output buffer and then clears.
- getAndFlushIncrementalErrorOutput(): returns incremental error output and the clears.

Tests for new methods are included on the PR.