Issue 23 - Fix NPE in MapperCodeGenerator

Appeared to be a race condition. Use of an explicit mutex object for
synchronisation appears to have fixed the problem