allow to close file handle when it's destroyed after unplugged.