Inverse Design of Whispering-Gallery Nanolasers with Tailored Beam Shape and Polarisation