Fixes abour replication lag

- Do not terminate master replication session until it receives all slave's ACK
- Handle slave's ACK received out of order.