Try to fix crash on NVidia cards

- Restore the old context after the current one is deactivated
- Fix dummy context activation and deactivation in some places
- Fix dummy context creation order