Add close protection for WorkbookWriter