Work is not a state function
Your definition of work is not quite correct.  A better definition is**

Work w, is the energy change that drives net shift in the distribution of mass in the system.

Thus energy here means total energy which is kinetic plus potential. Imagine going to the top of a building. You gain potential energy by virtue of being at the top (m.g.h, mass m, acceleration due to gravity g, and height h). If you are not sure that you have gained energy, think about what happens if you were to walk of the top of the building! 

You can walk up the stairs and gain this potential energy but you could also run up, and if you could manage to run, (huff-puff-pant-groan) the amount of work you would have to do is far more than walking, but the potential energy gained is exactly the same. Therefore in general the work depends on the 'path' taken, not just the starting and ending conditions. The word 'path' used in thermodynamics generally means the sequence of all the changes made to go from start to end. Hope this helps to clarify.

** ref A. Cooksey Physical Chemistry