add flint memory functions.

Allow memory functions to be replaced with custom ones, à la mp_set_memory_functions.