OPTION 1: If you want this behavior for every accordion on your website. Put the code below inside the Divi Theme Settings.

OPTION 2: If you only want this on specific pages you should put the Javascript code in a code module.

<script>
jQuery(function($){
    $('.et_pb_accordion .et_pb_toggle_open').addClass('et_pb_toggle_close').removeClass('et_pb_toggle_open');
    $('.et_pb_accordion .et_pb_toggle').click(function() {
      $this = $(this);
      setTimeout(function(){
         $this.closest('.et_pb_accordion').removeClass('et_pb_accordion_toggling');
      },50);
    });
});
</script>