libhardware: Add allocSize hook function.

Add allocSize hook function to support the custom buffer sizes

Change-Id: I0d55195cbc02af1001d6164ce8fd55380750c029
(cherry picked from commit df05397a51e2d52d45f74932212d6ccf53b044bd)
(cherry picked from commit 29abae57e4295d82297bdad6621d6795679672f3)
(cherry picked from commit b33f1d1897017a50c6fa7b6c1275449196f45e63)