circuit_state_publish() never triggers when a new origin circuit is created
In origin_circuit_init(), we change the circuit state before allocating the build_state but also before a purpose is set.
This means that circuit_state_publish() located in circuit_set_state() is never called for a new circuit because CIRCUIT_IS_ORIGIN() doesn't return true.
Which in turn, by chance I believe, made this NULL deref on build_state to never happen.
This should be fixed regardless.