Release locked buffer when it fails to acquire graphics buffer

The JNI buffer in ImageReader_imageSetup is not released when
it fails to acquire graphics buffer. After all JNI buffers are
exhausted, ACQUIRE_MAX_IMAGES will be returned and leads to
error. The JNI buffer should be released when it fails to acquire
graphics buffer.

Change-Id: I3319a58ac44e36c8593b404672a685c4b589a735
Fix for positioning of glyphs within a bitmap

For positioning of glyphs within a bitmap, roundf(int + float) is used,
where the float is the glyph position and the int is the text position.
When the text position is varied, this may lead to the sum being rounded
in different directions, due to floating point rounding, caused by that
floating point numbers have different precision in different ranges.

This may therefore lead to slightly different positioning for glyphs and
therefore slightly different widths and heights for text strings,
depending on the position they are rendered at.

The solution in this patch is to use int + (int) roundf(float), which
has consistent rounding, and also enables us to use the full range of
ints.

Change-Id: Id1143cdfcbdfa9915ced878ae04df589a3e03cee