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.