added lock guards round Katina core data structures when they are
modified (but not read).

plugin's threads can now safelt read those structures if they
synchronize on the same mutex katina.get_data_mutex();