Add workaround for code that replaces f_locals with a non-dict.

Enaml does this, and it breaks annotations.