Former Pakistan captain Malik retires from ODIs