Foreign rapist jailed for six years wins payout for ‘unlawful detention’