Towards Fair Machine Learning Software: Understanding and Addressing Model Bias Through Counterfactual Thinking