docparser: fix repeated 'when'

The second when for :cursor_type_ref will never trigger, causing us to
error out on unknown typedef contents instead of going with the name
catch-all. Fix that.