Relevant detail: Ottoman Turkish ⟨فستق⟩ fıstık borrowed it from Arabic ⟨فُسْتُق⟩ fustuq, that borrowed it from Middle Persian - the same variety as Greek and then Latin did. So odds are that the f-variation was caused by Arabic rendering a foreign [p] as [f], and probably predates Persian itself internally undergoing a p→f shift. Source.
Relevant detail: Ottoman Turkish ⟨فستق⟩ fıstık borrowed it from Arabic ⟨فُسْتُق⟩ fustuq, that borrowed it from Middle Persian - the same variety as Greek and then Latin did. So odds are that the f-variation was caused by Arabic rendering a foreign [p] as [f], and probably predates Persian itself internally undergoing a p→f shift. Source.