Support history file permission when persisting history commands into file