core: avoid possible asterisk -r crash from long id