InternalEngine - back to set dirty=false just *before* a refresh is done

reverting: 5553c383bca1f8b5437aa0eb34e291824e9057fb