Properly init and destroy rwlock attribute.