We can't easily do better because even the underlying
rcube_imap::list_folders will return an empty array if the LIST command
fails for some reason.
The only downside to this is that subscriptions will not be adjusted
when listed if all folders are removed for a type (can't happen for
mail). Seems like an acceptable price to pay.