[Inductor] Optimize finding users of buffers for mutation (#105882)
Rather than visiting all nodes in the current environment to determine the users of a buffer, register the users of a buffer after node execution.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105882
Approved by: https://github.com/jansel