Add internal EarlyExitCursor optimization (#8406)