IDE: Fix for access violation if form is closed by pressing its X button and then reopened via F12 button in desing mode, by Cyrax, bug 27141

git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@47123 4005530d-fff6-0310-9dd1-cebe43e6787f