Sox trade for All-Star closer Hanrahan