If your app is able to produce this kind of situation, then you should check collisions with the line from the previous position to the next one, instead of the just the next position point. This way you can never go through a wall.
But collision detection and physics computing are generally more reliable with a fixed timestep anyway.