fix 1450 file descriptor leak

--HG--
branch : 3.0
7 jobs for topic/3.0/issue-1450-file-descriptor-leak in 5 minutes and 56 seconds (queued for 1 second)