Return Proper Return Value to User Program

This change stores the return value in the task struct in case
a different task is scheduled.

Basic test was updated to test this.