Sir Keir Starmer's director of communications, Tim Allan, has resigned.