Fix VibratorService waveform accumulated delay

Change VibrateWaveformThread logic around delays while playing a
waveform to amortize processing/scheduling delays into the sleep part of
the thread. This should make the actual waveform duration closer to the
requested one.

Bug: 171133221
Test: atest FrameworksServicesTest:VibratorServiceTest
Change-Id: Iafe7f031444f68cd2cdc16883812874f385cba8e
2 files changed