Close open file handles in files library

ref #10392