Strange A3941 motor driver behavior
Here's one suggestion:
if (button_1_pushed)
{
      run_motor_in_one_direction();
}
else
if (button_2_pushed)
{
      run_motor_in_another_direction();
}
else
{
      stop_motor();
}