Add exclusive lock to batch building
Log pid to pomagma.util.mutex