Close/dispose connection if it was set