Wales midfielder Aaron Ramsey has apologised after being sent off late on during the 2-1 win over Scotland.