libthr: trigger library initialization on rwlock calls
(cherry picked from commit ad056b5d35d9957b1bd023abeb6461601449b725)