Change to root folder before opening log file

Previously, we weren't changing to the root folder before creating the log folder and opening the new file. This meant that if an audio files was opened first, the log would be created in the `audio` folder. We now change to the root folder first so that the log folder is created in the right place.