Reduce processing load in test assertAPIFailure
In trying to figure out why adding 'too much' (an exception) to the
return caused a memory out I realised that the print_r here is
realised regardless of whether it is needed. This fixes to only
resolve if it is going to be displayed. Arguably this would have
been a case where an inline function would have made sense - but
at the cost of readability - ie it's more helpful
to add code comments to explain the if than to make the codd hard to
follow. The only downside is the hypothetical
possibility of is_error being something other than 1,'1',TRUE - I
think if we thought that was a remote possibilty we would add
a unit test to add it - not cover it in an assertion