ReplicatedBackend: check result of dynamic_cast to fix null pointer deref

CID 1188135 (#1 of 1): Unchecked dynamic_cast (FORWARD_NULL)
 var_deref_model: Passing null pointer "t" to function
 "RPGTransaction::get_transaction()", which dereferences it

CID 1188134 (#1 of 1): Unchecked dynamic_cast (FORWARD_NULL)
 var_deref_op: Dereferencing null pointer "to_append".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>