Use closelog to explicitly close open resource.