wmflib: add ensure_directory() and ensure_link()

It's a common pattern to want to map a generic ensure parameter (that is,
present / absent) to an ensure for a directory or link File resource.
ensure_directory() and ensure_link() are convenience functions for doing that
concisely.

Change-Id: Ida5c809809379a1a35eca2e02bb6b28f36808f05