api: use malloc for rx thread arg instead of heap