autorotate: Use pathlib for extension check (fixes #58)