Raise an error if sleep is called inside the reactor thread