[KARAF-3325] Add a workaround to avoid sudden shutdown