fix fd leak (code not reachable yet)

by Doug Hogan <doug@acyclic.org>
Merge branch 'master' into portable