Added a lock for writing to brainfiles in the sentience plugin.
Hopefully avoid null e in events.
Renamedd the lock in the sentience module to corrospond with guidelines.