Coverity 1129269: Dereference after null check

add checks to deal with parent_objp == NULL

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10091 387891d4-d844-0410-90c0-e4c51a9137d3
fix gcc warning: declaration of ‘shipp’ shadows a previous local [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10092 387891d4-d844-0410-90c0-e4c51a9137d3