Prevent __toString() not handling all exceptions

There were cases where XHP could throw exceptions when type-casting to
a string, which PHP doesn’t like. Wrapping everything in try/catch
instead of just the private validation calls.