add function-y interface for setting halloc allocator

Functions can be easier to export across shared library boundaries on
platforms such as Windows.  This patch adds a simple interface for
setting halloc_allocator.