Suppress error while the last tabs is dragged over the tab itself
Find "insert before" reference tab and move the dragged tab to the upper level correctly, even if the parent tab has no next sibling.

This should work for cases like #297.