Well, I haven't implemented this, but you could do it in two steps. First, get the navigation path as you already are. Then run a second algorithm doing "line of sight" tests on the resulting points.
From point 0, raycast to point 2.
If it succeeds (doesn't hit a wall or otherwise untraversable tile) raycast from point 0 to point 3,
then 0 to point 4, etc. until eventually the raycast is intercepted at point N.
Remove all of the points between 0 and N - 1, because you know you can make a straight line between them.
Then continue the process with N to N + 2, N to N + 3, etc.
This is a slow way of doing it, and it's just off the top of my head, but it would work. There may be a better and faster solution which relies on the properties of the grid map.