Collapse in ultracold Bose Josephson junctions