Local connections weren't closed properly and none default ones were leaked

Fixes closing all existing local connections properly without assuming that there's always a DEFAULT connection (even if it was already closed)