Can associate multiple CVs with spinlocks

You can associate a CV with any spinlock.  This is so you can easily
have multiple conditions protected by the same lock.  Calling cv_lock()
on any of them grabs the common spinlock.
Fixes apipe_read_cond()

Uses a priority_reader CV, so that we can have only one reader at a
time.  In the process, I separated the reader and writer CVs too.  Since
we have multiple CVs sharing a lock, it's clearer to use a standalone
lock.  Maybe I'll switch over to the POSIX CV stlye in the future...