Some quick research on my end seems to suggest there's a setting for that scenario in advanced power settings called "Pause media players when suspending", I'd try that before anything else
Edit: As for why it happens, assuming it woke up from suspension/hibernation, for the most part programs are going to pick up exactly where they left off unless the system goes out of its way to tell them to perform some action (in this case, pausing). Since your lock screen is pretty much "on top" of the entire running system, so to speak, it results in the behavior you're experiencing.