stubs: add file and directory stubbing

Adds `stub_dir` and `stub_file` to create a temporary directory or file
that will be removed after the tests finish.

It also supports giving a name, which might be used when a test needs a
explicit directory or filename.
Merge pull request #8 from terlar/feature/file-and-directory-stubbing

File and directory stubbing