A 38-year-old man was killed by a 4m great white shark near Rottnest Island, Perth, marking the state's first fatal attack in over a year.