Try to create a file when appending if it doesn't exist.

Closes #12130