make tdestroy allow null function pointer if no destructor is needed

this change is to align with a change in the glibc interface.