(ITS#6764) ber_flatten() should return -1 on unmatched "{" "}"