Bug 253879 - unclosed class body causes method to appear twice

When facing unrecovered syntax error the AbstractASTParser erroneously
adds all found declaration (even those nested in other declarations) to
the root of the model. This way duplicate method declarations appear in
the model.

This patch fixes the issue by adding only the top declaration to the
model's root.

Incorrect tests fixed.

Bug: 253879
Change-Id: I1a5a46dcfc70625464924150fc1c64a6dee22f5d
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>