wmflib: add validate_ensure()

The alternative forms are all annoying to type and are used inconsistently:

  validate_re($ensure, '^(present|absent)$', "\$ensure must be..., etc.")
  if $ensure !~ /^(present|absent)$/ { fail("\$ensure must be..., etc." )
  if !($ensure in ['present', 'absent']) ...

So add this one, which will be faster than using regexes anyway:

  validate_ensure($ensure)

Yes, different resource types take other values for 'ensure'; but 'present' /
'absent' are the obvious universals, so I don't think that this will cause
confusion.

Change-Id: I1b55c0d4f9dede5690a3e3e8b72f4428eb49de86