TST: Silence some warning that turns up on OpenBSD.

On OpenBSD with gcc-4.2 log1p(nan) raises an invalid value warning.
This PR disables both 'divide' and 'invalid' for the log1p tests.

Closes #5017.

Rebased for backport to 1.9.