The escalating attacks are testing whether a rebound in crude oil exports from the Middle East can be sustained under high-risk conditions.