fix in attr_accessor_with_default that was causing TypeError "singleton can't be dumped"

Please find details in ticket:

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4776-patch-fix-attr_accessor_with_default-causing-typeerror-singleton-cant-be-dumped

Proposed patch removes incompatibility between attr_accessor_with_default implementation and Marshal.dump which is used in MemCache.

Thanks Serge