On the Generalized Duality Principle for State-Constrained Control and State Estimation Under Impulsive Inputs