core: unify memory allocations via pgt_alloc() calloc() wrapper