Remove a convoluted way of calling close by moving the call to the only caller.

As a bonus we can actually check the return value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224046 91177308-0d34-0410-b5e6-96231b3b80d8