Make sure data['level'] is a basestring

Fixes https://app.getsentry.com/sentry/sentry/group/13655045/