When using the SMF for a project discovered that events would sometimes
not propagate to parent states correctly. Could not create a minimum
reproducable test case for this, but it was found that these changes fixed
the bug. This commit creates a new function to reset internal state,
which is called on entry to smf_set_initial() and smf_set_state().
Closes#81300.
Signed-off-by: Geoffrey Hunter <gbmhunter@gmail.com>