To check if the headset jack-detection is working, install alsa-tools and run the jack-detection CLI tool with root privileges twice (once with headset plugged in and again with headset unplugged):
sudo hdajacksensetest --card=1
If the jack-detection is not working, it can be disabled using the jack retasking tool:
sudo hdajackretask
Always use microphone (even when "unplugged") instead of internal microphone - #3 by nikgnomic