Fix issues with duplicate starting window add requests

There might be cases where we have multiple requests to add a
starting window. To protect against this, we
a) Check for existing startingWindow when adding starting window
b) Don't send the message if we already an add request pending
c) Remove any pending requests when we handle one request

There was already existing logic in place that checked whether
we have a starting window. However, that doesn't cover the case
when requests are pending, but the window hasn't been added yet.

Test: Open settings, open any sub-activity, go home, kill
settings, reopen settings. This generates a duplicate add request
almost guaranteed.
Test: go/wm-smoke
Fixes: 75030092

Change-Id: I5cb7fc0a4e7ab13dce3766be6afe1aa4f85df2e7
2 files changed