gui/main: Don't Sync when opening note on macOS
gui/main: Don't Sync when opening note on macOS

  On Windows and Linux, we detect the app was launched via a note
  opening request in the main instance in the `ready` event handler if
  the process has arguments. In this case we would try to open the note
  and not start the Sync process or display any window.

  On macOS however, the detection is done in the `open-file` event
  handler which means the Sync was started and the tray icon displayed.

  We introduce here a variable that will be set to true when we launch
  the app and the `open-file` event is triggered before the `ready`
  event. This means the app was launched by the OS after the user tried
  to open a note from Finder.
  In the `ready` event handler, we don't start the Sync process if this
  variable is true. This means we need to setup the core App before this
  on all platforms or we won't be able to open notes on macOS (we need
  this to access the Pouch database and Cozy client).

cozy-labs/cozy-desktop,cozy-labs/cozy-desktop,cozy-labs/cozy-desktop,cozy-labs/cozy-desktop