dev/sg: make os.Exit check more granular, apply review comments
Created by: bobheadxi
Applies review comments from https://github.com/sourcegraph/sourcegraph/pull/35761 and https://github.com/sourcegraph/sourcegraph/pull/35760
Test plan
n/a
Created by: bobheadxi
Applies review comments from https://github.com/sourcegraph/sourcegraph/pull/35761 and https://github.com/sourcegraph/sourcegraph/pull/35760
n/a