Close the source after reading regardless of result.

Closes #757.