use caml_stat_alloc instead of a manual malloc+exception-check
Replace more occurrences of (m|re)alloc with caml_stat_(alloc|resize).