oiiotool --ch : if channel names don't match exactly, try case-insensitive.

This alleviates unexpected behavior for, as an example, a file with
channels R,G,B where the user tries

    oiiotool in.exr --ch r,g,b -o out.exr

Old behavior is, perplexingly, a black image, because no channel names
matched. New behavior is copying R,G,B. We first check for
case-sensitive match, so that if there is a file with mutiple channels
that differ only in case, it will find the exact match. Only when an
exact match is not found does it fall back on case-insensitive search
for the channel name.
thread.h: add atomic_exchange for int and long long