[API] Add hb_buffer_allocation_successful()

Returns the error status of the buffer.
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 11639ef..68ef594 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -260,6 +260,12 @@
   return _hb_buffer_ensure (buffer, size);
 }
 
+hb_bool_t
+hb_buffer_allocation_successful (hb_buffer_t  *buffer)
+{
+  return !buffer->in_error;
+}
+
 void
 hb_buffer_add_glyph (hb_buffer_t    *buffer,
 		     hb_codepoint_t  codepoint,