Close parsed files after each indexing iteration  (fixes #11949)

To test, attempt to add a file attachment to an image containing some
known string. Wait for indexing of the file to complete (should only be
a few moments if the system is up to date; otherwise check the
Indexer-0.log). Then search for the known string and check that the
image the file was attached to shows up in the search results.