loader: Make use of app provided allocation callbacks

Convert all heap allocs/frees to use loader_heap_alloc() or loader_heap_free().
Before CreateInstance this will use malloc/free. At (and after) CreateInstance
alloc callbacks are stored and used for any allocations.

Exceptions are thirdparty code (cJSON  and dirent_on_windows) still always use
malloc/free. Plan to address these in later patch if ti makes sense.
7 files changed