Merge "Fix race condition between restart and stop/reset."