Work around removed attribute_methods_generated? in Rails 4.0.4

Rails 4.0.4 killed attribute_methods_generated?, but made define_attribute_methods threadsafe and save to call multiple times.