BusinessTemplate: make portal type role export stable with > 10 roles
This sort was based on the id of the role definition but this did not work when the type definition had more than 10 documents, because:
>>> sorted(['1', '2', '10'])
['1', '10', '2']
This switches to an approach of converting the id to integer, with a fallback in case the id generator is customized.