Use standard library optimised routines for OUString/OString

..handling where possible.

Change-Id: I0b071988ed266cc2745a8ca9705c106a05edc557
Reviewed-on: https://gerrit.libreoffice.org/10020
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>