stl: don't acquire lock until dictionary generation is needed
Merge pull request #414 from ndawe/master

[MRG] stl: don't acquire lock until dictionary generation is needed