[common.parallel] adds gcc workaround in threadmanager

see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226