Make Random simulation thread safe

This ensures that simulations are reproducable.
This is the aftermath of https://github.com/contiki-os/contiki/pull/810 and https://github.com/contiki-os/contiki/pull/821

Will rebase this, once #810 is merged.