Fix the resource.fs.zfs.statechange message
Fix the resource.fs.zfs.statechange sysevent
It has a number of problems:
- It is only being emitted on a transition to the HEALTHY state. That makes it impossible for userland daemons to take actions based on drives getting sicker.
- It compares the new state to vdev_prevstate, which is the state that the vdev had the last time it was opened. That doesn't make sense, because a vdev can change state multiple times without being reopened.
- vdev_set_state contains logic that will change the device's new state based on various conditions. However, the statechange event is being posted before that logic took effect. Now it's being posted after.