events: make EventPriority.* usable as decorators.

this permits function definitions that do not have control over their
register() calls (e.g. Plugin.server_starting) to use a priority
other than MEDIUM.