Karabiner-Elements keeps running in the background even if you close the preferences window. To quit Karabiner-Elements, choose Quit Karabiner-Elements from menu bar.