Bug #9280: fix "Add postgis layer" creates a connection that is not removed until qgis is terminated

Changes:
+ Disconnect postgres connections created.
+ Fix deleteLayer not called in thread without event loop. 
   From Qt documentation: void QObject::deleteLater() [slot]  ...the object will be deleted once the event loop is started. If deleteLater() is called after the main event loop has stopped, the object will not be deleted. Since Qt 4.8, if deleteLater() is called on an object that lives in a thread with no running event loop, the object will be destroyed when the thread finishes.

Fix:
http://hub.qgis.org/issues/9280