Add lattice wait_needed.

Add a wait_needed, which takes a threshold operation and then waits
until someone attempts to read at a threshold; if one value is an
inflation of the other, the process which called wait_needed will
unblock.
Bump dialyzer warnings.