Backport rpmsg & smdpkt fixes into 1.24 stable branch
Fixes the crash as described in #20 (closed) but for the 1.24 stable branch.
I'm not sure of your future plans for this branch / when you plan to release 1.26 but in case you make another 1.24 release, I'd appreciate if these changes were included.