Adjust tab-removal bookkeeping so closing or losing a page before the active tab keeps the session pointed at the same logical page instead of silently shifting to the next one.
Add regression coverage for earlier-tab removal, later-tab removal, last-tab clamping, and the empty-page case.
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>