soc: fsl: qe: refactor cpm_muram_alloc_common to prevent BUG on error path