Avoid putting std::isfinite in global namespace

Some compilers/stdlibs (Intel 15 / libstdc++ 4.6) have different
isfinite functions in the global namespace and in namespace std.

Using using statements to put std::isfinite in the global namespace
or an global unnamed namespace makes unqualified isfinite(x) calls
ambiguous.

Dealing with cmath vs. math.h and where they put their definitions is a
proper mess, putting the alias in the closest namespace yields the right
result on both GCC 4.9.1 and Intel 15.

Also, stdlib.h needed for malloc/free.