Solomon Islands has signed a treaty naming Australia its primary security partner, ruling out foreign military bases and tightening limits on China.