Bugfix: None file pointer on closing doesn't crash anymore.

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>