Close opened FileSystems before throwing exceptions.

Fixes #14.