Added a flush call for the preferences

Change-Id: I16f43ed2d205e1279ef4233830461a3d055a484c
Signed-off-by: Simon Scholz <simon.scholz@vogella.com>