Generate jid in _wait in state module if not specified

Otherwise one would get a KeyError. This can happen when called in the mine with queue=True.