Add __reduce__ method to Message types.