Move private function out of the AT-SPI a11y backend
The textbuffer test is calling into a function defined by the AT-SPI accessibility backend. As of commit 4ddf1b70 we only build and run the test on Linux, but the function in question isn't really accessibility-related: it's just a serialization function.