Close the cog menu when user clicks outside of it