The Israeli military has dropped charges against five soldiers accused of sexually abusing a Palestinian detainee.