Implement yield() on Unix. Closes #665