I started to have this issue with my HTC Desire about 12 months ago and someone on a forum suggested an app called Wifi Static that solved the problem.
When I got my One S a couple of weeks ago I didn't wait to see if there was a problem, I just installed Wifi Static and I have never had any problem with losing wifi (including the Desire) for the past year.
I think it gives the phone a static IP, so maybe it's an app to do what was shown in the link, but with just one click