Add a test and a fix for Chef-5000 - FileEdit rewriting file without nee...

Fix for https://tickets.opscode.com/browse/CHEF-5000