don't trigger the create hooks when if the file already exists for file_put_contents

for #5196 

cc @bartv2 @DeepDiver1975 @karlitschek