Accidentally bumping the power button shouldn't kill a video I'm taking or a video conference I'm in.
The OS should block new uses of the camera if it's locked (sort of - face unlock obviously needs an exception), but killing existing ones seems rather aggressive and would create a new form of user hostility in relatively common situations.
Well for music, people may want to continue listening to music when their phones are off or the app is in the background.
For video I agree it doesn't make much sense, but in a web app world if you're recording video you may want to turn off the screen or do other things just like a computer. It should at least show you in the notification area.
i can think a scenario where the phone is acting as a sort of security camera. or you are using it as a replacement for web cam when you stream from your pc. etc.
but i agree most of those are edge cases.
And even edge cases should be supported. Maybe the default in Firefox should be to disable the camera when you lock your phone, but then it should have a setting to do otherwise, and it certainly shouldn't be rendered impossible by the OS (rather than, say, having a separate permission).