Replace .commit() with .apply() in PrefUtils.java

Fix according to issue #20