[JBMAR-171] added test case to ensure object with writeObject does not t...

...hrow NPE

Test case for:
https://issues.jboss.org/browse/JBMAR-171