Fixed a memory leak in os::read().

From: David Mackey <tdmackey@booleanhaiku.com>
Review: https://reviews.apache.org/r/14336