IDE: last active form: skip modal forms and nil if form is freed

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

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