Use AVA_GETS_OK macro in avalon_read.
Wait till the avalon_send_tasks thread has filled the avalon with idle work before starting the avalon_get_results thread.