Fix a subtle race condition between prepare_csp_for_next_request() and sweep()