core: fix condition on script callback number done inside EXTRA_DEBUG

- reported by Seudin Kasumovic, FS#388