Better exception safety in scan_for_matching_filenames.
More robust to malformed patterns.
Improved ordering of channels for EXR files.

Now we very robustly cluster "layers" together (with the unnamed layer
first, if it exists), and within each layer have a canonical RGBAZ
order.