Shareholders can sue Boeing over claims it ignored safety warnings about its 737 Max plane, a US judge rules.