[pulse] refactor models of malloc/alloc/new/...
[pulse] refactor models of malloc/alloc/new/...

Summary:
There was some code duplication between the various models of memory
allocators. Planning to add `new` and `new[]` soon so starting with this
refactor.

Reviewed By: skcho

Differential Revision: D30425966

fbshipit-source-id: d3692aa6b

facebook/infer,jvillard/infer,jvillard/infer,jvillard/infer,jvillard/infer,jvillard/infer,facebook/infer,jvillard/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,jvillard/infer,facebook/infer