NFC: Replace asserts with if() in SourceLocation accessors
Nowhere else in the AST classes assert on these kinds of accessors.
This way, we can call the accessors and check the validity of the result
instead of externally duplicating the conditions. This generality will
make it possible to introspect instances for source locations:
Differential Revision: https://reviews.llvm.org/D56354