Removes an attribute with the specified key and returns its current value, throws an exception if an attribute doesn't exist