Change captured_mi_execute_command to use scoped_restore