resolves issue #33, Cannot call setupterm() more than once per process

implement _CUR_TERM as a singleton, with much comments about what and why and how.

This also pulls in the @as_subprocess decorator, which is required for implementing the test case. It leaves all other test-cases as-is, unlike bugfix-4.