Australia snatched a morale-boosting draw on the final day of the first Test in Dubai.