Change wait()/callback API to use a single udata argument