Patch for preventing multiple installations/uninstallation at a same time

Signed-off-by: Arpit Goyal <agmps17@gmail.com>
this could be nicely done with ruby's ensure, i think