Thread test: Avoid potential leak and return first error

While we're not really concerned about a potential memory leak
like this in a test, we want to remove it so static analysis
tools looking for leaks won't trigger on this.

This fix also has the advantage that in the event of multiple
failures, we'll return the first one, which is probably most
helpful for debugging.

Test: TreeHugger
Change-Id: Ib8066d7055118a1db067198915815432ed142818
1 file changed