BUG: linalg: do not assume that GIL is enabled in xerbla_

With the new ufunc-based linalg, GIL is released in ufuncs, and needs to
be reacquired when raising errors in xerbla_.
BUG: linalg: fix LAPACK error handling in lapack_litemodule

If an exception is pending (raised from xerbla), the routines must
return NULL.
Merge pull request #3712 from juliantaylor/lapack-errors

backport Lapack error handling to 1.7.x
MAINT: use PyOS_snprintf instead of snprintf

PyOS_snprintf is portable and more secure than snprintf.
Merge pull request #3716 from charris/backport-1.7-3418

Backport 1.7 3418