Use isfinite() instead of finite().

finite() was from BSD days, isfinite() is the standard now.
Merge pull request #1116 from waywardmonkeys/use-isfinite

Use isfinite() instead of finite().