code for appending entries and handling append entries replies; commit index is updated appropriately