Possible freezing fix

Don't mutex lock the actual callback function calls, only the callback data structure access.  Can't reproduce Christian's problem with scrolling, but this does fix some hangups that I can force.
Also a better cache cleaner algorithm that sleeps until the expected time of the next file expiry.  This requires an interrupt when the cache period preference changes.  I included a controlled shutdown of the thread.