Only use GTB locks when multithread is defined

No binary change in default configuration. Tested with sha256sum.