Afghan security forces say they have retaken Jalalabad prison after at least 30 people were killed in an hours-long battle following an ISIL-claimed attack on the facility.