Fixed a bug in combine_demultiplexed_results function that made it write files multiple times.