Raise error instead of returning False during validation

review1125002
issue3412
(transplanted from 25f003e6e08617a991e99cc21d9fb7c9157e54c5)

--HG--
extra : transplant_source : %25%F0%03%E6%E0%86%17%A9%91%E9%9C%C2%1D%9F%B7%C9%15%7ET%C5
User.get_preferences must return a copy

preferences is stored in the cache but as it is a mutable object, we must
return a copy to prevent cache corruption.

issue3442
review1351002
(transplanted from de55086332d1f9f65b920c50c3692a6ee93216ed)

--HG--
extra : transplant_source : %DEU%08c2%D1%F9%F6%5B%92%0CP%C3i%2An%E92%16%ED