fix deadlock (recursive locking) in AttributeMethods::define_attribute_methods