Dynamics of first-order quantum phase transitions in extended Bose–Hubbard model: from density wave to superfluid and vice versa