Associate closefunc with trace object dtobj. Function closefunc is invoked with argument closearg when
dtClose() is called.
void dtRegisterCloseFunc(dt *dtobj, dtCloseFunc closefunc, void *closearg)