Fix for issue #2334835 reported by @yareckon: trimming API key before saving