Fix leaking FD.
Merge pull request #1314 from ddysher/fd-lead

Fix leaking FD