Fix memory leak and add INpaFile::IsDirectory