BZ-1000055: added test for NPE during KieSession serialization
(cherry picked from commit 1ba5c72206e6e8c8665fe8825a4d57e662d1fa06)
BZ-1000055: fixing NPE on RIANode serialization
(cherry picked from commit bc3bdf51da91f760f4f0344fff57ad5da4a41781)