Let engine thread parse difficult commands
The design of the adapter is completely changed: the engine thread is
made responsible for parsing and execution of all commands that cannot
be processed during a search. To this end it alternates between reading
from the engine (while the engine is searching, or should respond to a
'uci' or 'isready' query) and from the command queue (which is emptied
before we dedicate to relaying ponder output). Searches are terminated
by the GUI thread when a command arrives that would interrupt the search,
so that the engine thread will start looking at the command queue again.
Syncing threads to wait for an engine reply is replaced by just doing
a (blocking) read for engine output in the same threat, and having the
processing routine return once the answer has arrived (and is processed).
Instead the Sync pipe is now used to block reading of the command queue
when this is empty.
This change breaks several of the less elementary commands.
Fix command queue