I'm pretty sure convincing the imp to talk to Frederick has something to do with his demise. He never seems to die before this happens; he always seems to die shortly after.