In his new memoir ‘The Queerest of Folk’, the Welsh screenwriter talks Doctor Who’s past (and future), turning down two major franchises and an ‘uneasy’ meeting with Harvey Weinstein