aot_inductor: fix compile returning None if cache hits (#107020)
Summary:
Seems like a bug in D47998435, where when cache hits it returns None
Repro:
```
class TestModule(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x + 1
mod = TestModule()
inp = torch.rand(1)
out = mod(inp)
mod2 = torch.fx.symbolic_trace(mod, concrete_args=[inp])
so, _ = torch._export.aot_compile(mod2, tuple([inp]))
# 2nd time, it will return None
so, _ = torch._export.aot_compile(mod2, tuple([inp]))
assert so is not None # FAIL
```
Test Plan: Run the repro
Differential Revision: D48258375
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107020
Approved by: https://github.com/angelayi