Increase libthr WARNS to the default of 6, and fix the warnings
Fix warnings about:
- casting away volatile and const
- unused parameters
- a variable in a macro shadowing a local in a calling function
- no previous 'extern' declaration for non-static variable
- others as explained by #pragmas and comments
These have no effect, except for removing an unused parameter.