[module] Fix hiding of attributes when wrapping a function.

Fixes #390.