Make sure settings get synced when changing from the command line.

When using the command line --profile option to change an currently running instance of the program, the changes to the settings file go unnoticed when attempting to refresh these settings.  

The fix for this is to write the configuration, with a call to sync(), *before* disconnecting the socket, and reading the configuration file from the running instance with another call to sync() before reloading the joypad's configuration.