This refactors the ship registry and the OSWPT struct to store data as indexes rather than pointers. This is a prerequisite for making these collections dynamic in the future. See also #5800.
Update the Lua enums to be consistent with the new ShipStatus enums.
Separately, add an extra ship registry check in the event a ship doesn't exist in the ship registry.