It's definitely not offside.
Did Bernardo foul Sa in the split second whilst the ball was in play, before Stones headed the ball? Probably not. He may have impeded him slightly, but also, Sa pushed Bernardo, so it's six of one, half a dozen of the other. Plus in the light of Arsenal's regular...