Adding a mutex to the chanmod

Temp workaround for threading issues.