Compile fixes for FreeBSD
disk access caches allow concurrent lookups / loads.

Previously, if one loaded a file (LUT) that wasnt in cache, this would block
concurrent access of the file caches, even for different files.  With this
update, lookups for *different* files are non-blocking. However, lookups on
the same file *are* blocking; a lut should never be loaded twice from disk even
when concurrently used.

This change was added so image viewers which need real time performance can
efficienly use a 'prefetch' thread to see the file caches ahead of time. This is
particularly useful when used when playing clips with per-shot 3-D LUTs.
Update test to detect incorrect base usage in ApplyLinToLog, correct the bug
Merge commit 'upstream/master'