implement _CUR_TERM singleston + warning

this commit issue #33, but will not past tests, as it requires
@as_subprocess decorator, will cherry-pick that sub-process shortly,
implement as_subprocess decorator

so that different terminal kinds may be tested.

this also causes tests related to non-ttys to fail where those tests previously passed. as setupterm() had already been called (always with 'xterm-256color'), so subsequent calls would always succeed, even for StringIO streams with kind='unknown', or other values for `kind'.
import os missing for @as_subprocess

two commits should have been squashed, but weren't ...

git is not for the sub-genius.