v8: Cap Ninja parallelism based on available RAM to fix build OOM (#15922)