How come so many detectives on screen have troubled pasts? Does trauma make for better sleuthing? Or is it just for the plot? The evidence is in. Here’s the culprit