Protocols.HTTP.Query: Support async keep-alive.

If a Protocols.HTTP.Query instance is used with a keep-alive connection,
async_request fails if the remote end closed the connection.

Fixes [bug 7143].
Backend: Fixed stale thread state in poll devices.

The current thread was left swapped in during co_wait_interpreter()
in POLL_DEVICE_SET_EVENTS().

Also fixes condition variable leak (probably not relevant in most
thread implementations, but...).
Stdio.cp: Detect ouroboros.

Copying a directory to a subdirectory of itself would often trigger an
infinite loop.

Copying a directory to itself could trigger truncation of the files.

Note that it's still possible to trigger this behaviour by using symlinks.

Also fixes recursive_mv(), which either hanged in cp() as above, or
deleted all the files if cp() succeeded in the above cases.
CHANGES: updates for new 7.8 build.
release number bumped to 866 by export.pike
release number bumped to 867 by export.pike