Handle interfaces in the generate-externs task

See #2615.
/me discovered that `interface` is a reserved keyword.