Gracefully handle NaNs in Hamiltonian
Use boost::math::isnan instead of x != x trick for detecting NaNs
Merge pull request #126 from stan-dev/feature/fix_static_hmc

Gracefully handle NaNs in Hamiltonian. Fixes #121.