Add context manager for Mock.open().

The HdfsTarget's support this, so it makes sense to add to mocks
for compatibility.

Also snuck in a change to gitignore for some MacOS files.