Fix build failures occurring in GCC versions <4.8.

This works around a compiler bug, see for more information:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53613

REVIEW: 119583
Also wait for impl to finish parsing.

This fixes the test flakyness for me.