Failure in __str__() before any output.

When calling str() on a spawn class object before
it has any command output, the __str__() override
attempts to truncate long command output while the
value of self.before is still None, raising:

    TypeError: 'NoneType' object has no attribute '__getitem__'
use isinstance of 'str', not 'basestring'
Use ternary if/else in spawn.__str__
Use str(p) and not p.__str__()
Merge pull request #142 from pexpect/failed-str-self

Failure in __str__() before any output.