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.

I'd like to use this for https://bugzilla.mozilla.org/show_bug.cgi?id=682216 assuming it can be merged and updating the in-tree copy is no problem.