SYSCALL_ERROR_HANDLER for kopensolaris/x86_64

Copy from linux/x86_64.
Some work will be needed for kopensolaris/i386,
which can be safely copied from linux/i386.
(only take care of syscall args and return values)
See the history for linux (git log -p)
XPG7 fix for kopensolaris bits/stat.h

Everybody already has done it, see for example:

sysdeps/unix/bsd/bits/stat.h
commit f095bb7204d80f609a73a22796edd6cffd4c6add
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Jan 9 10:56:41 2010 -0800

    Add support for XPG7 testing.

    The header conformance testing code needed extending for XPG7.  This
    exposed a few bugs in the headers.  There are more changes to come.