Speed up the saving of the preferences on macOS.
This is done by importing the config data using defaults import in
one go, which is much faster than the previous implementation which
invoked the shell to run defaults write for each individual key.