Fix compilation under gcc 4.9 and clang 3.4 (both using libstdc++)

by adding missing include required for use of std::function