Catch OSError, IOError when attempting to spawn subprocess