Fixed mulnw case by refactoring the code

In this for UB checking, we simply extend the multiplication result
to twice the width and then truncate it to original width and compare
if the original multiplication result and the truncated one are equal.