Fix a bug where a FileStream instance was not closed at all.

Fixes loading modules in some use cases.