Lambda function to stop the motor.
This function should perform any necessary actions to safely stop the motor.