Re-introduce glue layer closure building error.

This reverts part of b15ffe2ef0dad103aa83d8946e1b4516ae01ec8e,
and fixes 'fail_compilation/fail10666'.
Merge pull request #621 from klickverbot/dtor-closure

Re-introduce glue layer closure building error.