US secretary of state uses Munich speech to urge allies to dispense with ‘foolish’ policies in security, migration and climate