runtime: malloc -> caml_stat_alloc, free -> caml_stat_free

(got rid of the remaining direct calls to malloc and free)
runtime (memory.c): hattach must never be called with a NULL pointer