You'll get this error because you tried to modify the user roles in a way that drupal did not expected it. Solution, instead of using unset(), do:

    $form['account']['roles']['#access'] = FALSE;