DOSGI-188 Improve fix so imports are closed only when last service instance is released and prevent false removal events