Philadelphia refinery cuts deal with local union, likely averting strike