Simplify fbstring::insertImpl
Simplify fbstring::insertImpl

Summary:The current implementation of `insertImpl` assumes that
`expand_noinit` does not reallocate if the `size() + delta <=
capacity()`, but D3114022 makes this assumption invalid when compiling
with ASan. It also doesn't guarantee exponential growth, so repeated
inserting at the end could trigger quadratic behavior.

The new implementation fixes the problems above, and it's much
simpler.

Reviewed By: yfeldblum, Orvid

Differential Revision: D3119813

fb-gh-sync-id: 946ebeeaf924a531f7f03fb7e79c75e352a50c58
fbshipit-source-id: 946ebeeaf924a531f7f03fb7e79c75e352a50c58

mqeizi/folly,mqeizi/folly,floxard/folly,brunomorishita/folly,facebook/folly,brunomorishita/folly,floxard/folly,floxard/folly,Orvid/folly,rklabs/folly,charsyam/folly,brunomorishita/folly,charsyam/folly,Orvid/folly,charsyam/folly,facebook/folly,Orvid/folly,facebook/folly,mqeizi/folly,facebook/folly,floxard/folly,rklabs/folly,charsyam/folly,mqeizi/folly,floxard/folly,brunomorishita/folly,brunomorishita/folly,rklabs/folly,mqeizi/folly,Orvid/folly,facebook/folly,Orvid/folly,rklabs/folly,rklabs/folly