Primary categories bug fix

Fixes an issue where primary categories were not read back to the
display field correctly (though they were always recorded) and
rectifies a situation where rows would be saved to exp_category_posts
with a category_id of 0.