Ensure dim changes are in same transaction; do not wait for token to change visibility

- Use the pending transaction to avoid collecting changes to the same
dim in separate transactions. This was causing problems since
multiple WindowStates can request a dim change, and they were doing so
by placing the changes in different transactions. This was an issue since there was
no guarantee that they were then merged in the correct order.

- Check for the requested visibility of the token to avoid waiting for it to change its visibility at the end of a transition. This allows to
shield the dim from changes to its windows while it waits to be
committed.

Fix: 288863491
Test: DimmerTests
Change-Id: I96f8d1b091dd0f897c50833be7540b00fa2ead70
(cherry picked from commit af7f6b2297f745e2065a52a7f535ce282c25331c)
3 files changed