utils: Add convenience function for setting fd flags