‘It’s going somewhere, hopefully’ — Top US admiral says the Navy’s struggling $500 million railgun project is a lesson in how not to develop weapons