Defer file close