Fix error in test_apply.cpp, make wrapper operator() const

We should also look at fixing the apply_kernel.hpp code so that
it isn't susceptible to generating infinite recursive variadic
templates when there's a problem with the input function object