MainWindow: fix clamping function and avoid saving position/size if maximized or minimized
Merge pull request #47 from xponen/remember_size

MainWindow.cs: fix window-size clamping function, and only save size&position when  not maximized & not minimized