About the first problem:
Well, you are querying the state of the key every frame. So, given a refresh rate of 60Hz, then your loop will query the state of the key 60 times per second. If you hold the key down for a duration of 66 milliseconds, then four iterations of your loop will see that button pressed down.
About the second problem:
The reason why the window becomes unresponsive is because when you suspend the program execution via the debugger, then window messages sent by the OS will not be processed anymore (which happens by calling glfwPollEvents()). So the process does not react anymore to anything the OS is asking of it, and the OS will therefore assume the process has died and will indicate that to the user by overlaying any window the process has created.