A book that drew comparisons between an inept Chinese emperor and President Xi Jinping has been pulled from shelves in China.