Better parsing of nsswitch.conf action brackets

Fixing some overzealous DCHECKs that were designed to keep some helper
parse methods from being misused without first stripping off '[' and
']', but were getting violated on extra '[' within the action text.
E.g., "[SUCCESS=[RETURN]" parses out the action text as
"SUCCESS=[RETURN", which then violates the DCHECK looking for '['. Make
the DCHECKs more allowing to let stuff like that through and get
recognized as invalid/unknown action labels.

Also, because it's an easyish case to handle and it lets me keep some
DCHECKs in place (e.g. that the first char of an action text still isn't
a bracket), let the parser ignore repeated brackets only at the
beginning or end of an action block, rather than get treated as an
unknown label. Nothing so advanced as matching opening and closing
brackets, just merging repeats into being treated as one.  E.g.,
"[[SUCCESS=RETURN]]" or "[[SUCCESS=RETURN]" will parse fine. Unknown
if there are any posix implementations that would allow that, but the
configured intent is clear enough, so we might as well parse it when
not too inconvenient for Chrome.

Bug: 1197850
Change-Id: I664f4321d822f5f2fd8e544ef90bad568f5c8eaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2822035
Reviewed-by: Dan McArdle <dmcardle@chromium.org>
Commit-Queue: Eric Orth <ericorth@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872151}
GitOrigin-RevId: 72dd9c3fdb793a04e1b13722ebf411a949889ba1
2 files changed