Improve test coverage.

Test for some error cases by using the operating system mocks.
Merge pull request #12 from smspillaz/cpp-subprocess.item_12

Improve test coverage.