BUG: Fix for result in states.file.prepend to return the correct result when test option is set (see issue #15397)
Merge pull request #15500 from basepi/bp-15466

Backport #15466 to 2014.7