Don't use deprecated Numpy API
Clean up premalloced memory

This fixes a rare memory leak if creating the premalloced memory
tracking object fails.
Fix rare memory leak if PyArray_SetBaseObject fails
Set just the type object fields we need