Ensure overlapping compositor locks can time out

With the current logic in Compositor::GetCompositorLock(), if a lock is
being held with no timeout and another lock is being created that has a
timeout value, the second lock will never time out. The lock can be
held indefinitely if the caller was relying on the timeout.

This changes the behavior of GetCompositorLock() so that a lock with
a non-null timeout will override a lock that had a null timeout, causing
them both to timeout. Potentially this could cause unexpected behavior
where a lock without a timeout value is still timing out, but this can
already happen if the locks are taken in the inverse order.

Bug: 739621
Change-Id: I32cfbbbc61adf14db263aa413e4019877b041d70
Reviewed-on: https://chromium-review.googlesource.com/587464
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489942}
3 files changed