prevent duplicate actions on a post

This improves [PR 810](https://github.com/discourse/discourse/pull/810) by generalizing the check on duplicate user actions as per @SamSaffron's suggestion.