Fixes #12145 without slowing down on other platform or for single files that don't need the concat file.