improve generate_random_token() (and make it work for python 3), test both Lock and LuaLock