Add functions to get/set the return stack.

Fixes #464.