Ensure set_prepare_statement is called once only