That's strange, in any case a easy solution would be to download Easy Battery Saver and use its intelligent mode. It will automatically switch off WiFi when you lock your phone and turn it on when you unlock it. If you never want it on and its turning on automatically, idk what's causing that to...