bst: fix bstree_replace() to update the thread links

Thanks to 'zjx20' for spotting.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>