fixed notification of connection status to switch-manager
add errno check when delete the pid file