Properly handle delegate literals in nested context code.

They can be demoted to function literals without being static.

GitHub: Fixes #447.