Always close stream in readPreferences(). Fixes #729.
Merge branch 'pr730' into pulls