Are you using VNC Viewer? If so, you should see an icon (bottom left). Open that and it should give you a virtual keyboard option. Open the keyboard and select <ALT> <F4> and the browser will close. If you don't have the icon, I'm not certain what's wrong.
Im using VNC viewer on an IMAC but don't have that virtual keyboard option for some reason. I tried to find it in settings but nothing.