Write test for ownership of file.managed with makedirs=True

Closes #1264. (Better late than never!)