[JIT] Do not allow creating generics with None types (#44958)
Summary:
Otherwise, invoking something like `python -c "import torch._C;print(torch._C.ListType(None))"` will result in SIGSEGV
Discovered while trying to create a torch script for function with the following type annotation `Tuple[int, Ellipsis] -> None`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/44958
Reviewed By: suo
Differential Revision: D23799906
Pulled By: malfet
fbshipit-source-id: 916a243007d13ed3e7a5b282dd712da3d66e3bf7