Ex-foreign minister Steinmeier elected new German president