Python metaclass for making instances of user-defined classes immutable