Hi egsuh,
I created a quick demo project with a datamodule and a link to a firebird database. Then I set connected property to true, also activated a query. When I close the IDE, the datamodule indeed hangs for a few seconds, but then everything it's closed, no zombie process in the task manager. So unfortunately I cannot reproduce the issue.
Please try the following:
1. Go to Tools->Configure "Build Lazarus"
2. Select profile "Debug IDE", then rebuild lazarus
3. Open lazarus.lpi, you can find it in the IDE sub folder of the lazarus installation
4. Click the run button, now a second instance of lazarus should appear
5. In the second instance open your problematic project, then close the IDE
6. The first instance of Lazarus should break where the exception is or at least you should get some info about the problem