Fix bug #392, reported by Jonathan Giddy <jon@dstc.edu.au>: In posixmodule.c:posix_fork, the function PyOS_AfterFork is called for both the parent and the child, despite the docs stating that it should be called in the new (child) process.
Fix bug #392, reported by Jonathan Giddy <jon@dstc.edu.au>:
In posixmodule.c:posix_fork, the function PyOS_AfterFork is called for
both the parent and the child, despite the docs stating that it should
be called in the new (child) process.

This causes problems in the parent since the forking thread becomes the
main thread according to the signal module.

Calling PyOS_AfterFork() only in the child fixes this.  Changed for both
fork() and forkpty().

sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator