BlackBerry reports surprise profit on cybersecurity strength