The head of Scotland's police union has criticised a revised code of conduct for police searches, calling it "politics at play".