Hack to avoid memory leak with Clang

Clang 3.4 seems failing to properly destruct value-captured objects in a lambda abstraction. We resort to a normal function object.