Catch exceptions on malformed categories.

Simply adds try/catch. This prevented importing contacts/calendars in some cases.
@bartv2 @georgehrke