Adding ability for a context to be terminated in a forked child process

This pull request adds code to replace file descriptors inherited by a parent context with new ones at context terminate allowing for the context to be terminated in the child without interfering with the io threads in the parent process.

Test included. Code review welcome.