test: clean up signal_multiple_loops

The test uses some questionable binary math.  Rewrite it in a more
explicit fashion.
unix: add atomic-ops.h

Add cmpxchgi(), cmpxchgl() and cpu_relax() functions that we can use
as simple primitives to build spinlocks out of.
unix: add spinlock.h

Add an atomic, non-blocking spinlock type.  The primary use case is to
have a mutex type that we can use while inside a signal handler.
unix: clean up uv_tty_set_mode() a little
unix: make uv_tty_reset_mode() async signal-safe

Make it possible to call uv_tty_reset_mode() from inside a signal
handler.  The primary motivation is to make it possible to restore
the TTY from inside a SIGINT or SIGTERM signal handler.

Fixes #954.
include: add E2BIG status code mapping

Forgotten in commit 3ee4d3f.  Add it now and renumber the other status
codes.  The Windows status code mappings may not be exhaustive.

Fixes #959.
windows: fix duplicate case build error

Mea culpa, the previous commit added another ERROR_FILENAME_EXCED_RANGE
case to the switch statement in uv_translate_sys_error().  This commit
fixes up the build error.
windows: remove unneeded check

Cheking if the loop is alive is covered in the while loop afterwards.
Also, the stop flag will be cleared if necessary, which didn't happen
before this patch.
include: document pipe path truncation behavior

Document the fact that the maximum path length for UNIX domain socket
paths is much less than _POSIX_PATH_MAX.

For most file systems, _POSIX_PATH_MAX is 1024 or 4096 bytes while
`sizeof(sockaddr_un.sun_path)` is typically between 92 and 108 bytes.
Adds <stdlib.h> to satisfy reference to abort.
build: Fixes check target for mingw.
test: Removes replacement snprintf for mingw.

Mingw has a proper definition of snprintf.