If any extract is waiting to be erased, then bail out as this will distort the cost calculation and possibly lead to infinite loops. Fixes #129373 (cherry picked from commit 5ddf40fa78705384966c22da78e12134df7bd723)