Fix preferences storage when no changes were applied

When storing unchanged preferences the UPDATE query affects no rows,
so an INSERT is issued and fails because of duplicate primary keys.

This problem is fixed just by ignoring the INSERT error.
Use new preferences repository everywhere

Switch to the new preferences repository where the old preferences "model" was
being used
Use Http Foundation Session instead of CodeIgniter sessions

It still doesn't use Doctrine to store sessions, but now we do not depend
on CodeIgniter session handler.

Note: session options (inside advanced.php) have changed
Fix Vagrant cache issue

There are sendfile issues with Vagrant. Have a look at
http://stackoverflow.com/questions/9479117/vagrant-virtualbox-apache2-strange-cache-behaviour/9480164#9480164