Finishes the machine or thread and calls its destructor, if defined.
If the machine is finished when it has running threads the machine
will fatally fail. User must always finish the threads before
finishing the machine. This type is returned in the state function.