Generate random message id.

See original pull request here: https://github.com/01org/liblwm2m/pull/29