Revised fix for bug 931.

We can't directly determine that a %fork operation is a task or function
call, so need to infer this by comparing the parent and child scopes.