Assign the posts format spinner to an instance variable instead of using findViewById each time we save.

Also added a null and index check when getting post format value. Fixes #1449