Better Safari caching workaround, and skip the HEAD request

Uses Content-Range response header in the first 206 to get the
total byte size instead of a separate HEAD request.

Changed workaround for Safari range caching bug to only trigger
if we detect a bad range, and then use a consistent query parameter
until we get another bad one.

This seems to reduce unnecessary cache churn, as the bug seems most
likely to trigger when reaching the end of the file and then going
back, rather than when going forward.