checkDLLAttribute: remove a redundant dyn_cast

The same dyn_cast was done earlier in the function. No functionality change.