tests: fix error reporting from Mkdir calls

Whenever the creation of a directory fails, it was trying to report an
error from an outer scope.
test: fix if expression
Merge pull request #30 from fsouza/mkdir-error-report

tests: fix error reporting from Mkdir calls