gproject: Fix opening already opened files from the sidebar

Also always focus the editor window when changing a file.