Finish any event in the current input queue
Finish any event in the current input queue

When the pipelining optimization was added we never updated
handleImeFinishedEvent to look through the whole queue of items, so it was only
looking at the head.

Bug: 8498214
Change-Id: I79c62392a93b47e3e1eab3f4fe54a5c999dfb566

xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base