[yafuse]: fix memory leak;
          refactor code for subsystem command of 'history';