Almost £600,000 in compensation was paid to prisoners in Northern Ireland’s jails in a five-year period.