fix Issue 8960 - Unable to set thread priority

- Ignore error when get-/setting the priority of a terminated thread.
Merge pull request #550 from MartinNowak/fix8960

fix Issue 8960 - Unable to set thread priority