ENG-6428: make persistent binary deck clean empty segments, tests and re...

...factor.