[DO NOT MERGE] libutils: fix overflow in SharedBuffer

See
https://code.google.com/p/android/issues/detail?id=181910

Bug: 22952485
(cherry picked from commit 7987b83553804156aeca61b4c111c2b983c4c551)

Change-Id: I3cac87185f209dc79678ae702aa18afbdf4190df
3 files changed