pthsem: new package

two real changes to add new package pthsem which should replace the one in old packages
.. and many commits to revert other commits ...