All legal same-sex marriages to be recognized for tax purposes, IRS says