Fix sanitizer in surfaceflinger waitForEvent.

The loop in EventThread::waitForEvent as it is currently constructed
results in two unsigned overflows as a result of the increment/decrement
operation. This causes runtime errors on integer sanitized builds.
This patch refactors the loop to avoid these overflows.

Bug: 30969751
Test: Compiles and device boots. Runtime error no longer emitted.

Change-Id: I2eaa44c0910f19847d366210cafc947efaebfb2d
1 file changed