Added file permissions to open() call when O_CREAT is specified.

Review: https://reviews.apache.org/r/21778