Marine veteran who lost both legs in Afghanistan sworn in as NY police officer