Fixed a failed check for Tracker.flush() during a Tracker.Computation

When the `Tracker.flush()` function is called while a `Tracker.Computation` is running, an error is usually raised. However, a small oversight in the code causes this check to fail after a nested `Tracker.Computation` completes. This could lead to an infinite loop.

This change adds a test proving the existence of the bug and the fix for it.