MessageQueue: track tail of queue

Give us a chance at avoiding O(N) behavior when inserting an item at the
tail of the queue. This patch showed a significant (~35.7%) decrease in
system_server contention during post boot period.

This code is guarded by Flags.messagequeueTailTracking().

Bug: 305311707
Test: atest MessageQueueTest
Test: boot system and use it
Change-Id: I19a258bc092ca49d612080d25be548524f86fddc
1 file changed