Bug 1029632 - prevent leaks through adding pref cache, r=bz, a=sylvestre