[dynamo] fix prim lowering validation logic for dynamic shape args (#111208)
Fixes https://github.com/pytorch/pytorch/issues/111199
Fixes https://github.com/pytorch/pytorch/issues/111203
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111208
Approved by: https://github.com/ezyang