Check 'frozen' and 'enclosed' before moving Thread

When moving a Thread from one ThreadGroup to another, both
the source and the target ThreadGroup must not be frozen or enclosed.

This fixes #950.