Fixed order of checks for socket uniqueness.