Handle interfaces in the generate-externs task

See #2615.
"No newline at end of file"