Merrill I would keep. There's no reason to keep Gustafsson.
Given all 3 of Leskinen, Fleury and Brook could see NHL time next year, I'm not sure Merrill really fits in, unless there is a complete rebranding of the D. Weber, Petry, Chiarot and Edmundson are probably here to stay, unless one goes to Seattle. You also have Romanov of course, and Kulak is under contract for one more year. Not to mention Ouellet as an 8th/9th kind of depth guy. That means Merrill is likely 11th or 12th on the depth chart, so I don't see why he would sign here.
Of course, trades could occur. And I certainly hope Bergevin is active this off-season to strengthen the D. But bringing in a new top-4 guy definitely does nothing to help Merrill's place on the depth chart, as he would just fall further down.