The boat speed is obviously affected by the angle to the wind and the angle of the sails. In answer to the question, if sheeting out isn't helping you, then you have to change the angle of the boat, i.e. head into the wind. Now in your case you said that you couldn't change course as it wasn't safe which only leaves the sail angle.
As I understand the theory, you should sheet out the mainsail to reduce speed when there is a flow of air going over the sail. This is fine if you're sailing from a close reach to a broad reach but when the wind is behind you and is pushing the sails (not flowing over them), then the further you sheet out, the more area of sail you are exposing and the closer to the actual windspeed you will go. Since you say that the windshift came right behind the boat, then I guess if you had sheeted in and with the traveller, you should have slowed down. Sounds great in theory doesn't it!!
I guess in hindsight, the best thing that you could have done was to turn into the wind early and since the wind was onshore it would have drifted you backwards towards the beach at a nice slow rate. Again, sounds great in theory
Certainly I've done the same thing and flown up the beach on many occasions and had to pay the price recently by having to fibreglass the bottom of the hulls.