Use RUSAGE_THREAD, if available

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add lib/getrusage.c

Abstract out the SELF/THREAD complication.

Signed-off-by: Jens Axboe <axboe@kernel.dk>