Handle forward declarations

* Keep track of empty structs as possible forward declarations, and
  replace with actual definition if found.

Previously, the forward declaration was included in the output, and
the second (true) declaration was missing.