This PR fixes two issues that cause rebuild to fail, see #5222.
The first was caused when sync.target and sync.interval were not set,
this was fixed by changing the default values from null to "undefined"
and filtering these out later.
The second error occurred when the .config/joplin-desktop directory
didn't exist (e.g. when installing Joplin for the first time) which
caused the touch command to fail. This was fixed using mkdir to ensure
that .config/joplin-desktop exists.