[BZ-1032064] return null for non-declared EntryPoint in reteoo
(cherry picked from commit 3fe05335c18f476b6e3c071ce06e037430475608)
[DROOLS-363] make incremental compilation to work with declared types
(cherry picked from commit b88dab15355640fb6eaa5842e0e9cc0027335769)