memcg: fix possible use-after-free in memcg_write_event_control()