use native rwlocks where available
move lock attrs to static scope
adjust config.m4 to look for rwlock abilities
remove some useless stuff from m4/w32
adjust locking calls on sma