Check argument type in get_date utility function before processing it

Sitemap plugin calls this method to convert `modified` metadate into
datetime. Depending on the version of Pelican `modified` can be string
or a datetime object.

Therefore get_date should check for the type of argument otherwise
Pelican fails with a critical error.