SI-6863 Fix verify error in captured var created from try/catch

If a var is assigned from a try/catch and it's captured into a ref
then we were generating invalid byte code. The fix basically
undoes commit b2f3fb271342d7862cc045f5ee5cff6815ac9722
and adds a test to make sure this case doesn't regress again.

review @magarciaEPFL, @paulp