Fixed a bug in VimuxNearestPaneIndex function

The for loop iterator was used as an index, which may cause erroneous
results.
Added an option to select the nearest inactive pane in reversed order (farthest pane)
Automatically select the first pane (active or not) if launched from a graphical session (gVim, MacVim)