`GetOutputOp`: Refactor and Improve error handling. (#9721)
This PR improves error handling of `LoweringContext::GetOutputOp()`, by
creating a new `LoweringContext::SafeGetOutputOp()` function that
returns an status-like variable. It also refactors the
`lowering_context.{h,cpp}` C++ files.
**Key Changes:**
- Created `SafeGetOutputOp()`, which is an implementation of
`GetOutputOp()` function, but propagates the error status down the line
- `GetOutputOp()` calls `SafeGetOutputOp()`
- `GetOutputOp()` users are not immediately affected
- Add missing includes ([IWYU ref][1])
- Remove `OutputMap<T>` declaration (using PyTorch
`torch::lazy::OutputMap<T>`)
[1]:
https://google.github.io/styleguide/cppguide.html#Include_What_You_Use