File cache cleanup to prevent memory leaking.