implement process wait when using LSOpenApplicaion on OSX