It is possible but when the task switcher detects that an app cannot be closed, it will ask you if it should kill the process.
I think there is some API for task-switcher, but likely there is no API for disabling close button in switcher view. One option which may be viable in your case, is setting window not to show in task-switcher at all.. You can do that with gtk_window_skip_taskbar_hint().