Dolphins end losing run with win over Rams