Safari and Chromium on Mac get input language from other apps
Welp, since different input sources for different documents are no longer in OS X as of 10.9, I don't have the problem anymore.

Now I use Punto Switcher to switch the language for different applications, and it does that fine (although it seems to hang language switching altogether once in a while).