link_queue.cc: fix another bug triggering busy wait detection

Make sure conditions match in wait_time() and write_packets() to
guarantee we will write at least one packet.