keep wp_insert_post from adding duplicates

The problem ended up being the hook after_setup_theme. I was effectively invoking the function by refreshing the browser which launches the hook in both Javascript and PHP so the hook was being triggered more than once when the browser was refreshed.

Once I disabled Javascript everything worked fine. Another solution would have been to use a different hook that is only triggered once.