Handle deadlock, exit properly

The number of live fibers is kept track of so that the library can exit
cleanly once all fibers have exited (with ufiber_exit()).  This means
that calling ufiber_exit() in the "root" fiber does not kill all fibers.

Functions which block may return EDEADLK if doing so would cause
deadlock.  The variable "last_blocked" tracks the last thread to block,
so that schedule() always has a thread to wake up if it detects
deadlock.  In theory, schedule() should only detect deadlock after at
least one blocking function has been called, so last_blocked is not
checked for NULL.  We'll see.
Unit tests

Use check for unit testing.