nios2: return -errno from INTERNAL_SYSCALL
nios2 reports syscall errors in r7 and the positive errno in r2, and the
arch header passed that flag out through the err parameter. The generic
lowlevellock.h, however, hands the raw return value to its callers, which
read it as -errno: lll_futex_timed_wait() comparisons against
-EWOULDBLOCK and -ETIMEDOUT never matched, and sem_post() silently
swallowed errors. Fold the flag into a negative return value in the asm,
like the kernel does for the arches that have no flag register, and let
the generic ERROR_P/ERRNO macros from syscalls-common.h do the rest.
The same conversion is due for the other arches that still hand the flag
back separately -- mips, alpha, ia64 and tile -- and for powerpc, where it
is the reason sem_wait() and sem_post() misread their return value.
Signed-off-by: Ramin Moussavi <lordrasmus@gmail.com>