fix alfred link command when scope does not exist

alfred preference helper commands were incorrect when the scopes
preference did not exist. the type was not being properly being set to
array, so you'd end up with a string of ('foo', 'bar', 'baz') in the
alfred preferences instead of a true array. alfred would then decide
that the search scopes are totally empty.

this separates out alfred read/write code paths and allows explicit
specification of the type of the value being written.