javascript: check for keywords as identifiers

Fixes a bug that breaks test015 for the javascript backend.