Cleanup fix for #475 (forbid use of locals() in jitted functions)

Remove duplicate exception ForbiddenConstruct, and factor out the hardcoded test for ``locals()`` in a private constant.