Add support for waitid().