Check the isInUse with the lock held in MessageQueue

Fix a potential race condtion when the same message object
is being enqueued by two threads.

Bug: 150263007
Bug: 154867444
Test: atest android.os.cts.MessageQueueTest
Change-Id: Id79448ba8719479cbdb054f2cdd172fdcbe86d47
(cherry picked from commit 96a6fec4d651607f0f0b659dd2e8dccaa9b1ed43)
1 file changed