String Dynamics and Higher Spin Anti-de Sitter Gravity