BUG: linalg: make umath_linalg to track errors from all inner loop iterations

This ensures that the FP invalid flag always reflects the return code
from LAPACK. Fixes a bug in 63a8aef81 where umath_linalg raises a
warning only if the error occurs in the last iteration of the ufunc
inner loop.
ENH: linalg: use signature= for internal casting rather than astype in linalg ufuncs
TST: linalg: test return types of generalized linalg routines