CLN: avoid Unboundlocal error in tools/merge/_get_concatenated_data (GH3833)

closes #3833