Fix authentication loop bug (#35)

The authentication loop bug is caused by the 'remember me' function logging in with the stored username and password, even if they are incorrect. This patches checkLogin() in masterpage.js so that if the login has failed it removes the cookies with the incorrect details.