Remove few lines in unix socket handling

Mark Andrews requested to merge feature/master/unix-cleanup-v9_11 into v9_11

Reuse the same checks two times, make difference minimal.

(cherry picked from commit 72d81c47)

Merge request reports