Add guards to random.h

These guards are missing and make it hard to use.