A process for the preparation of imiquimod and intermediates thereof