Setting a key using send should return the new value

There seems to be an unnecessary line at the end of `internal_write_key`
that results in `send("#{key_name}=", value)` returning nil. This breaks
compatibility with 0.12.

The `@attributes` variable that is set to nil in the last line of
`internal_write_key` does not appear to be
referenced elsewhere.