fix #1544

We have already reserved that register in codegen()'s case NODE_DEF, but
what we care about is actually the previous register. So what we need is
get that register by cursp() after pop(), then recover the reservation
by push().
add a regression for #1544
update test code to ensure return value from class statement