append label only when formatted is not undefined

I'm using select2 to fetch remote infinite data, but all of the data belong to a optgroup, like

    Empty (optgroup)
      box1
      box2
      ...

it works well for the first request, but from second request, it generates Empty optgroup every time, which is not my expectation.

My solution is override formatResult method, return undefined if the optgroup already exists, then fork select2, check `formatResult` result, if it is undefined, I don't append the container.