Fix a few issues with the new bookmarks handling code

I noticed a few issues with the way bookmarks are handled since f96357d. For instance, clearing the bookmarks file manually without resetting the sidebar-bookmark-breakpoint value as well, would cause newly added bookmarks to remain hidden despite the "Bookmarks" section being shown in the sidebar. Moreover, this PR avoids a segmentation fault caused by a missing NULL check in the DND code.
I suppose it's probably unnecessary since it'll be corrected the first time bookmarks are changed (I think just the fact that the number could be wrong for quite some time bothers me)