Screen orientation fix

Wrapped orientation function in try command; checking existence of
screen and screen.lockOrientation was unreliable