Hamas has returned the final four hostage bodies due in the first phase of a ceasefire deal with Israel that has largely held, despite numerous setbacks.