Remove unnecessary typename in function.hpp and closure.hpp

This fixes a warning when compiling these files with clang.