A New Method for Detecting Critical Threshold for Setting Ramp Metering by Considering the Safety Issue during Merging