kmodloader: fix compilation warning with not checking return of asprintf
Fix the following compilation warning:
kmodloader.c: In function 'main_loader':
kmodloader.c:1027:41: error: ignoring return value of 'asprintf' declared with attribute 'warn_unused_result' [-Werror=unused-result]
make[1]: *** [package/Makefile:116: package/system/ubox/compile] Error 1
1027 | asprintf(&m->opts, "%s %s", prev, opts);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While at it rework the function to not duplicate too much code with the
error handling.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>