At the end, Dr Sloan runs into the bathroom to escape somebody shooting at him. He slammed the door shut and ran to the window which he couldn't open. The camera pans back to the door that is now locked. Dr Sloan didn't lock the door.
When Mark, Dick Van Dyke, is trying to shave with the straight razor, he is simply dragging the blade backwards. This would not shave anything as the blade needs to go across the face edge first.