Bug Fix

priority cal access destroyed stream
     - while calculating priority, task may access a stream already
       destroyed by the other task of the stream
     - fix: when destroy stream, set the other task's stream point to NULL

This works with all examples committed by Bert.