sd-dhcp-client: refactor state machine check