iPhone 4 flashlight won't turn off even when powered off
make sure the app is turned off
You can try resetting the phone by pressing the sleep and home button for almost 10 seconds. If the flash light is still on after resetting it, you should call Apple customer service for professional advice.
Take a picture with the flash. I got the light to turn off on my wife's iPhone 4S this way