Wait for close event in order to match on file content.