Add threshold read.

Add a threshold read primitive to derflow with a test to ensure
correct behavior.  Register waiting processes with a threshold, so
notifications are only delivered when the threshold is met or passed.