fix functional test context for permissions.

* Effectively reverts 65d5c841061401a1a71d9abd1a5da5695cc34f30. "printf
  debugging" showed that the nested context blocks were not executed at
  all, so setup for correct/incorrect permissions was not happening
  correctly
* Fixes incorrect assertion that file resources should report being
  updated when no changes were made.
Merge branch 'functional-test-context-fix'