Process write overflow with number of elements

We want to keep 1/2 of the elements available to read after a write
overflow, regardless of the size of the types in the queue.
If the queue has only 1 element, we can not leave any elements
available to read after an overflow.

Test: atest fmq_unit_tests fmq_test
Bug: comment from ag/29519872
Change-Id: I9d6cacea1045cbaea1c42c925d2e9bc82ce7785c
2 files changed