Remove split pair according to last visible task

Sometimes a split pair may exit in the background. At this time, the
stage has no visible tasks and cause missing to reomve the split pair.

This is to get the last visible task id to remove the split pair.

Bug: 267245649
Test: atest WMShellUnitTests
Change-Id: I995518f4f3171f545ef78f9c6c40b34310a041ac
2 files changed