Use directly captured this instead of parent reference for nested state machine inside another state machine without anonymous storey. Fixes #12762