Mean-field dynamics of a two-mode Bose-Einstein condensate subject to noise and dissipation