BUG: fix leaking errstate, and ignore invalid= errors in a test

Apparently, Numpy behavior is different for Python2.6/Numpy 1.5.1
compared to more recent versions.
Merge pull request #3663 from pv/fix-errs

BUG: fix leaking errstate, and ignore invalid= errors in a test