[WIN] Handle WM_SIZE in maximize case

Fix #753
[OSX] Free Window object when closing CDT

Fix #1391