ReFF: Reinforcing Format Faithfulness in Language Models across Varied Tasks