firmware_TouchMTB: fixed a bug in discarding initial packets

In some cases, after discarding initial packets in noise tests,
it results in list index out of range error.

This situation occurs when all fingers happened to leave at the
time instant when creating the final state packet which is an
empty list, i.e., [].

When creating a new packet list after discarding initial packets,
be careful not to include the empty final state packet.

BUG=chromium:430826
TEST=Conduct unittests on a chromebook or in chroot.
$ cd /usr/local/autotest/tests/firmware_TouchMTB
$ python tests/run_all_unittests.py
All unit tests should pass.

Before the bug was fixed, running the unit tests would result in
an IndexError: list index out of range.

Change-Id: I034d85d9629c7ece61f22001a676c8b2784907a2
Reviewed-on: https://chromium-review.googlesource.com/228091
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
3 files changed