U.S. independent refiner HollyFrontier Corp posted a quarterly profit on Wednesday, compared to a year-ago loss, as its refining margins rose.