s/dyn_cast/cast/ where return value should never be null.

cast<X> asserts the type is correct and does not return null on failure.
So we should use cast<X> rather than dyn_cast<X> at such places where we
don't expect type conversion could fail.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205332 91177308-0d34-0410-b5e6-96231b3b80d8