[os_crypto] fix compiler warnings

Here is the test code I just put together to learn about this:

```C
THE-SILENCE :: ~ % ./a.out
rand1 hu: 17767
rand2 hu: 17767
rand1 lu: 1804289383
rand2 lu: 17767
rand1 ld: 1804289383
rand2 ld: 17767
THE-SILENCE :: ~ % cat randominttest.c
#include <stdlib.h>
#include <stdio.h>

int main()
{
  long int rand1;
  u_int16_t rand2;
  rand1 = random();
  rand2 = (u_int16_t)rand1;

  printf("rand1 hu: %05hu\n",rand1);
  printf("rand2 hu: %05hu\n",rand2);
  printf("rand1 lu: %05lu\n",rand1);
  printf("rand2 lu: %05lu\n",rand2);
  printf("rand1 ld: %05ld\n",rand1);
  printf("rand2 ld: %05ld\n",rand2);

}
```

This is sure an issue ;)