Explicitly include <functional> header

This fixes failing build (at least on ArchLinux).