Close file if Open fails.

fixes #1