Fix: libcrmcommon: assert if can't generate operation key
This is a refactor of generate_op_key() to use the existing
crm_strdup_printf() function instead of its own allocation,
and use CRM_ASSERT() instead of CRM_CHECK() for argument validation.
This simplifies the code, avoids allocating more memory than needed,
and results in assertion failures instead of returning NULL on errors,
which is preferable because existing callers don't check the
return value for NULL before using it.