Fix @meets_deadline.

Makes @meets_deadline and friends check that a permission is valid
(unexpired) before using it.  Note: the line of code this edits should
arguably be removed entirely, but that may require some discussion.
Merge pull request #800 from learning-unlimited/fix-deadlines

Fix @meets_deadline.