ensure sleep and process_events are called at least once during a ghost sleep call

Previously, if ghost.sleep was called with a small (or 0) value it was possible to break out of the while loop during the first check without ever calling time.sleep or Ghost._app.processEvents