TST: lib, linalg: fix blas tests with intent(in,out) arguments

f2py intent(in,out) does not guarantee in-place operations.

(cherry picked from commit 7376a5aba5498ad3f6b5ec45d543fe0c2740f0ce)