Add function ag_window_is_usable()

This function can decide if a given window is usable for opening a
new chart.
Prevent AgApp for opening a new window for imports unless necessary

It checks the current window, then all the other windows if there is a
usable among them. Only if there is none, it will create a new window.
Merge pull request #81 from gergelypolonkai/bug-65

Chart import doesn’t open a new window upon import, unless necessary