I updated the nRF Connect SDK to latest master. It currently uses Zephyr 7d20f2ebf2. Most of the time (~4 times out of 5), calling sys_rand32_get() crashes the firmware and the nRF9160 reboots.
As a temporary workaround, I enabled CONFIG_XOROSHIRO_RANDOM_GENERATOR.