use apply for preferences instead of commit

Stops UI thread from blocking when the app decides to change a preference.