For ENG-5865, differentiate between deallocate wrappers and dummy wrappers to fix a bug deallocating non-pointer direct buffers