Handle recursive data during exception handling

print_r is causing out-of-memory under PHP 5.4.4 when debug dumping
data with recursive content, so fall back to existing var_dump print
variant, which can handle the recursion.  Both code paths partially
emulate var_export, sigh.

Change-Id: I5c7ac21b4947e6aa08676693e8d858118a642108
Merge "Handle recursive data during exception handling"