Don't keep file in memory when it's closed

Fixed #1525

review: @devoncarew