Fixed ref counting for returned rs objects

Bug: 25777125

As reported in the bug, currently an rs object referenced in a return
statement may be cleared at the end of a block, even before the
return expression is evaluated or any thing is actually returned.

This may cause a crash on the statment, when the return expression
references such objects, or cause the caller to crash on using a rs
object returned by such a function, when the return expression is a
single local variable reference.

This CL avoids such crashes by creating a local variable for the
returned value, and not calling rsClearObj on the new local variable.

Proper reclaiming of the returned objects would be in a seperate CL.

Change-Id: I49b683aa95aa1c600bf30e792bf830f762c2fe79
1 file changed