Fix potential proxy failing issue

Re-add '-w' option for launchctl commands
Remove json settings when failed to launch proxy
Escape special charaters when generating json