Some more work on cleanup.
Original commit message from CVS: Some more work on cleanup. - added two functions in the scheduler _setup and _reset to initialize the context. In the case of the cothread context we have to map the cothread stack space onto the threads stack. - setup/reset the scheduler context in the threads context. - fix the ghostpad cleanup. - slightly changed the scheduler code to cleanly remove connections.