libknc: fix up and parameterise processing of internal queues.

We parameterise the sizes of various buffers.  These are not hard
sizes, though, given that we have a lumpy stream.  We do not [yet]
expose these parameters to the caller as we have not settled on
a naming convention or API for this.

We fix up the processing by making a better attempt to call
knc_process_{in,out}() at the correct times.

We also implement knc_need_input() and knc_can_output() which return
boolean answers which we hope are obvious from their names...