BUG: fix non-c99 fallback for np.inf input to log1p/expm1

closes gh-4225
Merge pull request #4415 from juliantaylor/log1p-expm1-no-c99

BUG: fix non-c99 fallback for np.inf input to log1p/expm1