Fix failing requirement tests. Fixies #623
Added checks for shells to close in PreferencePage ok and cancel method. Fixes #639