Support inplace LU decompositions

This fixes the tests breaking in ndarray-linear-solve, and should also speed up the solver.