Roald Dahl was an unpleasant man who wrote macabre books – and yet children around the world adore them. Perhaps this shouldn’t surprise us, writes Hephzibah Anderson.