A man has been charged over an incident that allegedly led to a police officer's gun "unintentionally" being fired near a cafe at Sydney Airport.