Eliminate race condition around oset variable.

With the help of a set of macros, oset is now an automatic variable
on the stack of each thread instead of an unprotected global var.

The modif compiles but is not tested yet. I will launch an endurance
test and report back every few days how things go.