fix(sync.js): trim dead branches on set

Related: #52