1) Pass length through to str8 function.
2) Fix implicit function definition warning.
3) Check for NULL from bio_get_string16 functions.
Bug: 15886919
Bug: 15888753
(cherry picked from commit 7d42a3c31ba78a418f9bdde0e0ab951469f321b5)
Change-Id: I1f826b88826561ea126d811c087ba30623141511