MAINT: Simplify some uses of errstate context manager.

This changes, e.g.,

    with np.errstate():
        np.seterr(divide='ignore')
        ...

to

    with np.errstate(divide='ignore'):
        ...
Merge pull request #4831 from charris/simplify-with-errstate

MAINT: Simplify some uses of errstate context manager.