Bug 912020 - Reduce DB access count

https://bugzilla.mozilla.org/show_bug.cgi?id=912020
1. Avoid unnecessary refresh in settings app to reduce DB access count
2. Add a flow control in keyboard helper to reduce DB access count