Free closure when bound_function is destroyed

Fixes #1.