Osc: Fix bug that crashes app when creating new plot
     - Happends only when optimization level of the gcc is below -O2
     - Fix is: get the size of the window when we are sure that the window is realized.
     - Fix 2: inexplicably a segmentation fault occurs when extracting a gchar value from a tree model.