Allow spawn() and friends to be used as context managers

Closes gh-111