libc: add waitpid for porting CRuby