BUG: to_json - prevent various segfault conditions (GH14256)
- [x] closes #14256 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

There were several sources for the JSON string buffer at enc->start exceeding the reserved space:
- Loops on DataFrame columns being stuck on the same column if enc->errorMsg was set. This is fixed by adding the check for the errorMsg to the respective iterNext function.
- Loops on objects (Dir_iterNext) not breaking due to similar reasons, which allows infinite recursion. Also added check for errorMsg.
- Column labels were added in iterName methods inside objToJSON.c where the check for remaining buffer was not accessible. Moved Buffer_Reserve to the ujson header file.
- Closing brackets could be added without sufficient buffer. Added Buffer_Reserve calls.
