rS348215 changed jail_getid(3) to validate passed-in jids as active jails (as the function is documented to return -1 if the jail does not exist). This broke the jail option (in some cases?) as the jail historically hasn't needed to exist at the time of rule parsing; jids will get stored and later applied.
Fix this caller to attempt to parse *av as a number first and just use it as-is to match historical behavior. jail_getid(3) must still be used in order for name arguments to work, but it's strictly a fallback in case we weren't given a number.
[reviewer's note]
Future work should probably change the kernel interface in some way or note in the interface the caveats of the jail parameter. If given a name, it'll resolve to a jid immediately and the name gets lost in transition to kernel -- if the jail restarts and is given a different jid, the rule doesn't follow the name unless the rule's re-evaluated (which isn't done frequently, I would assume). Jids passed in aren't validated for existence and always apply to a jail with that jid, it would likely be nice if jail names worked the same way.