Simulator: fix random location selection

Sqlite does not wrap integer overflows (possibly changed in version 3.8.2), which was assumed for random selection of locations. Reduced to modulo 2^31 space as a workaround.