Tests: fix Safari userAgent detection

(cherry-picked from 3f3f458974fe0bdccfe9042c9503fd2d03e2f6ff)