build: typecast NGREG to int

Fixes the following error with musl libc:

src/trap.c: In function 'traphandler':
src/trap.c:178:3: error: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Werror=format=]
   snprintf(tmpbuf, sizeof(tmpbuf), "Register dump [%d]: ", NGREG);
      ^