lang.exists() returning false positives (alternate patch)

Alternate patch (compared to https://github.com/dojo/dojo/pull/81) for lang:exists() returning false positives.  

See https://bugs.dojotoolkit.org/ticket/16291.