Evolutionarily stable strategies in diploid populations with general inheritance patterns