The closure of Grangemouth oil refinery will “compromise” Scotland’s national security, a Labour MP has said.