Yes, locked doors do keep you safer in a crash. In a crash, an unlocked door can fly open. If you are not belted in securely, you can be thrown out of the vehicle and seriously injured. If you lock the door, on the other hand, and your car is involved in a crash, the seatbelt/locked door combination will keep you safer inside.
Further, a locked door, helps to maintain your car’s body integrity in a crash, protecting you. The locked doors also keep the roof from crushing down if the car should roll over. It is true that even locked doors will fly open if an accident’s stresses exceed their tolerance, but it is equally true that those tolerances are quite high, on the order of pressures exceeding 2,500 pounds.