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.