fix implicit decl warnings

Include the proper headers to fix warnings like:
libnfs-sync.c:1529:3: warning: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
libnfs-zdr.c:506:2: warning: implicit declaration of function 'getuid' [-Wimplicit-function-declaration]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

sys/time.h needs to be protected with an ifdef

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
fix typo in chmod funcs

These were accidentally calling chown instead of chmod.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
fix implicit decls of rpc_{g,s}et_error

Signed-off-by: Mike Frysinger <vapier@gentoo.org>