Replace NEWOBJ macro with newobj<T> and newres<T> functions.

Summary: We already had to do different things for objects and resources,
and heap parsability will make them diverge further. This diff
makes them a) modern and b) easier to grep for.

ext_zip also had some bugs that this fixes.

Reviewed By: @jdelong

Differential Revision: D1655816