improve EM_ASM to tolerate quotes when safe, and error when not; fixes #2032