PHP: Wrap __toString() in try-catch to avoid unhelpful fatals

PHP doesn't allow __toString to throw exceptions and will trigger
a fatal error – with entirely unhelpful message – when it does.
Add a wrapper around the real toString() to convert the exceptions
to errors.

To test, try commenting out the OOUI\Theme::setSingleton() call
in demos/widgets.php.

Change-Id: I86125ba4c2141f7a575efe9e2fcd4c7ff1651a42