add rusage support to wait() and waitpid()

patch by Anton Stepanenko