chdir and fchdir need to return a 'long'

I made them return an intreg_t because other syscalls use this type
(which is a little weird), but no matter what we use, we need to make
sure the value returned is sign extended properly to the size of a long.

This is necessary because Go has a generic syscall wrapper that examines
the return value and checks to see if it is "-1" before allocating a new
AkaError struct and returning errno and errrstr up the stack. On amd64,
when a syscall just returns an 'int', the upper bits are 0'd out and we
interpret the value as 2^32, not -1 (which indicates a success). We also
cannot simply donwcast the return value to 32 bits before doing the
comparison because some system calls (e.g. mmap) can have valid values
that have all lower 32 bits set to 1.

This isn't a problem for glibc because it doesn't have a generic wrapper
around all syscall. It can down cast the return value to the proper type
in the libc wrapper before doing the check of whether or not to return
an error.