A Royal Navy sailor jailed in Bahrain has been granted a royal pardon by its King.